Glossary termConcept

Software Framework

Also known as: Framework, Application framework

Reusable software platform that provides a predefined structure and calls developer-written code at set points, shaping how an application is built.

A software framework is a body of prewritten code that supplies the skeleton of an application, leaving developers to fill in the parts specific to their project. A web framework, for instance, handles receiving HTTP requests, routing them to the right code, talking to the database and rendering responses, while the developer writes the functions that implement each page or endpoint. Well-known examples include Django and Flask for Python, Ruby on Rails, Spring for Java and Angular for front-end web development; game engines play a similar role for games.

The defining feature of a framework is inversion of control. With a library, the application is in charge and calls the library's functions when it needs them. With a framework, the framework is in charge and calls the application's code at defined extension points, an arrangement sometimes nicknamed the Hollywood principle. Frameworks often bring conventions about file layout, naming and architecture, such as Model-View-Controller, so that much configuration can be skipped; Ruby on Rails popularized the slogan convention over configuration.

Frameworks speed development by solving common problems once, encouraging consistent structure across teams and building in protections against issues such as Cross-Site scripting and SQL injection. The trade-off is constraint and dependence. Applications become shaped by the framework's assumptions, upgrades between major versions can require substantial work and an abandoned framework can strand the projects built on it. Debates over whether a tool such as React counts as a library or a framework turn on exactly how much control it takes over an application's structure.

Key points

  • A framework provides an application's overall structure and calls developer code at defined extension points.
  • Inversion of control distinguishes frameworks from libraries, which applications call on their own terms.
  • Frameworks often encode conventions and built-in protections against common web vulnerabilities.
  • Dependence on a framework can make major upgrades costly and leaves projects exposed if it is abandoned.

Related entries

Glossary term

Software Library

Programming

Collection of prewritten, reusable code, such as functions and classes, that programs call on to perform common tasks without reimplementing them.

Glossary term

Software architecture pattern that separates an application into a data model, views that display it and controllers that handle user input.

Glossary term

Bundle of tools, libraries, documentation and samples that developers use to build software for a particular platform, device or service.

Glossary term

Technique in which an object receives the components it depends on from outside rather than creating them, making code easier to test and change.

Technology

React

Programming

Open-source JavaScript library from Meta for building user interfaces out of reusable components that update efficiently when data changes.

Glossary term

Game Engine

Video GamesProgramming

Software framework that provides the core systems for building games, such as rendering, physics, audio, input, scripting and editing tools.

Glossary term

Web application that loads a single HTML page and then updates its content with JavaScript instead of loading fresh pages from the server.

Referenced by

Other entries that discuss or point to Software Framework.