![]() |
|||||||||||||
|
Software framework |
| It has been suggested that application framework be merged into this article or section. (Discuss) |
A software framework, in computer programming, is an abstraction in which common code providing generic functionality can be selectively overridden or specialized by user code providing specific functionality.
Frameworks are similar to software libraries in that they are reuseable abstractions of code wrapped in a well-defined API. Unlike libraries, however, the overall program's flow of control is not dictated by the caller, but by the framework. This inversion of control is the distinguishing feature of software frameworks.1
Contents |
The designers of software frameworks aim to facilitate software development by allowing designers and programmers to spend more time on meeting software requirements rather than dealing with the more standard low-level details of providing a working system. For example, a team using a web application framework to develop a banking web site can focus on the operations of account withdrawals rather than the mechanics of request handling and state management. However, developerswho? commonly complain that using frameworks adds to "code bloat", and that due to competing and complementary frameworks and the complexity of their APIs, one often trades time spent on rote programming and design for time spent learning to use the framework.
Having a good framework in place allows developers to spend more time concentrating on the business-specific problem at hand rather than on the "plumbing" code behind it. Also a framework will limit choices during development, so it increases productivity, especially in large and complex systems.
Software frameworks typically contain a considerable housekeeping and utility code in order to help bootstrap user applications, but generally focus on specific problem domains, such as:
According to Pree,7 software frameworks consist of frozen spots and hot spots. On the one hand, frozen spots define the overall architecture of a software system, that is to say its basic components and the relationships between them. These remain unchanged (frozen) in any instantiation of the application framework. On the other hand, hot spots represent those parts where the programmers using the framework add their own code to add the functionality specific to their own project.
Software frameworks define the places in the architecture where application programmers may make adaptations for specific functionality — the hot spots.
In an object-oriented environment, a framework consists of abstract and concrete classes. Instantiation of such a framework consists of composing and subclassing the existing classes.8
When developing a concrete software system with a software framework, developers utilize the hot spots according to the specific needs and requirements of the system. Software frameworks rely on the Hollywood Principle: "Don't call us, we'll call you."9 This means that the user-defined classes (for example, new subclasses), receive messages from the predefined framework classes. Developers usually handle this by implementing superclass abstract methods.