Software framework
Encyclopedia
In computer programming
, a software framework is an abstraction
in which software providing generic functionality can be selectively changed by user code, thus providing application specific software. It is a collection of software libraries providing a defined application programming interface
(API).
Frameworks contain key distinguishing features that separate them from normal libraries:
to develop a banking web-site can focus on the operations of account withdrawals rather than the mechanics of request handling and state management
.
By way of contrast, an in-house or purpose-built framework might be specified for the same project by a programming team as they begin working the overall jobspecifying software needs based on first defining data types, structures and processing has long been taught as a successful strategy for top down design. Contrasting software data, its manipulation, and how a software system's various grades and kinds of users will need to either input, treat, or output the data are then used to specify the user interface(s) some types of access being privileged and locked to other user types all defining the overall user interfaces which to the users are the visible in-house Framework for the custom coded project. In such a case, each sort of operation, user interface code and so forth need written and separately integrated into the job at hand also more or less adding to necessary testing and validation.
Frameworks often add to the size of programs, a phenomenon termed "code bloat
". Due to customer-demand driven applications needs, both competing and complementary frameworks sometimes end up in a product. Further, due to the complexity of their APIs, the intended reduction in overall development time may not be achieved due to the need to spend additional time learning to use the framework, which criticism is clearly valid when a special or new framework is first encountered by a development staff. If such a framework is not used in subsequent job taskings, the time invested in learning the framework can cost more than purpose written code familiar to the project's staff; many programmers keep copies of useful boilerplate for common needs.
However, once a framework is learned, future projects can be faster and easier to complete; the concept of a framework is to make a one-size-fits-all solution set, and with familiarity, code production should logically rise. There are no such claims made about the size of the code eventually bundled with the output product, nor its relative efficiency and conciseness. Using any library solution necessarily pulls in extras and unused extraneous assets unless the software is a compiler-object linker making a tight (small, wholly controlled, and specified) executable module.
The issue continues, but a decade-plus of industry experience has shown that the most effective frameworks turn out to be those that evolve from re-factoring the common code of the enterprise, instead of using a generic "one-size-fits-all" framework developed by third-parties for general purposes. An example of that would be how the user interface in such an application package as an office suite grows to have common look, feel and data sharing attributes and methods as the once disparate bundled applications grow unified; hopefully a suite which is tighter and smaller as the newer evolved one can be a product sharing integral utility libraries and user interfaces.
This trend in the controversy brings up an important issue about frameworks. Creating a framework that is elegant, versus one that merely solves a problem, is still an art rather than a science. "Software elegance
" implies clarity, conciseness, and little waste (extra or extraneous functionality, much of which is user defined). For those frameworks that generate code, for example, "elegance" would imply the creation of code that is clean and comprehensible to a reasonably knowledgeable programmer (and which is therefore readily modifiable), versus one that merely generates correct code. The elegance issue is why relatively few software frameworks have stood the test of time: the best frameworks have been able to evolve gracefully as the underlying technology on which they were built advanced. Even there, having evolved, many such packages will retain legacy capabilities bloating the final software as otherwise replaced methods have been retained in parallel with the newer methods.
Software frameworks define the places in the architecture
where application programmers may make adaptations for specific functionality—the hot spots. These hot spots are usually formalized by defining an explicit component Interface, or a defacto interface as defined by some existing component that is being overridden. Without a framework though, "there is no such thing as a component"
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.
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." 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.
Computer programming
Computer programming is the process of designing, writing, testing, debugging, and maintaining the source code of computer programs. This source code is written in one or more programming languages. The purpose of programming is to create a program that performs specific operations or exhibits a...
, a software framework is an abstraction
Abstraction (computer science)
In computer science, abstraction is the process by which data and programs are defined with a representation similar to its pictorial meaning as rooted in the more complex realm of human life and language with their higher need of summarization and categorization , while hiding away the...
in which software providing generic functionality can be selectively changed by user code, thus providing application specific software. It is a collection of software libraries providing a defined application programming interface
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...
(API).
Frameworks contain key distinguishing features that separate them from normal libraries:
- inversion of controlInversion of ControlIn software engineering, Inversion of Control is an abstract principle describing an aspect of some software architecture designs in which the flow of control of a system is inverted in comparison to procedural programming....
- In a framework, unlike in libraries or normal user applications, the overall program's flow of controlControl flowIn computer science, control flow refers to the order in which the individual statements, instructions, or function calls of an imperative or a declarative program are executed or evaluated....
is not dictated by the caller, but by the framework. - default behavior - A framework has a default behavior. This default behavior must actually be some useful behavior and not a series of no-opsNOPIn computer science, NOP or NOOP is an assembly language instruction, sequence of programming language statements, or computer protocol command that effectively does nothing at all....
. - extensibilityExtensibilityIn software engineering, extensibility is a system design principle where the implementation takes into consideration future growth. It is a systemic measure of the ability to extend a system and the level of effort required to implement the extension...
- A framework can be extended by the user usually by selective overriding or specialized by user code providing specific functionality. - non-modifiable framework code - The framework code, in general, is not allowed to be modified. Users can extend the framework, but not modify its code.
Rationale
The designers of software frameworks aim to facilitate software development by allowing designers and programmers to devote their time to meeting software requirements rather than dealing with the more standard low-level details of providing a working system, thereby reducing overall development time. For example, a team using a web application frameworkWeb application framework
A web application framework is a software framework that is designed to support the development of dynamic websites, web applications and web services. The framework aims to alleviate the overhead associated with common activities performed in Web development...
to develop a banking web-site can focus on the operations of account withdrawals rather than the mechanics of request handling and state management
State management
State Management refers to the management of the state of one or more user interface controls such as text fields, OK buttons, radio buttons, etc in a Graphical User Interface. In this user interface programming technique, the state of one UI control depends on the state of other UI controls...
.
By way of contrast, an in-house or purpose-built framework might be specified for the same project by a programming team as they begin working the overall jobspecifying software needs based on first defining data types, structures and processing has long been taught as a successful strategy for top down design. Contrasting software data, its manipulation, and how a software system's various grades and kinds of users will need to either input, treat, or output the data are then used to specify the user interface(s) some types of access being privileged and locked to other user types all defining the overall user interfaces which to the users are the visible in-house Framework for the custom coded project. In such a case, each sort of operation, user interface code and so forth need written and separately integrated into the job at hand also more or less adding to necessary testing and validation.
Frameworks often add to the size of programs, a phenomenon termed "code bloat
Code bloat
Code bloat is the production of code that is perceived as unnecessarily long, slow, or otherwise wasteful of resources. Code bloat can be caused by inadequacies in the language in which the code is written, inadequacies in the compiler used to compile the code, or by a programmer...
". Due to customer-demand driven applications needs, both competing and complementary frameworks sometimes end up in a product. Further, due to the complexity of their APIs, the intended reduction in overall development time may not be achieved due to the need to spend additional time learning to use the framework, which criticism is clearly valid when a special or new framework is first encountered by a development staff. If such a framework is not used in subsequent job taskings, the time invested in learning the framework can cost more than purpose written code familiar to the project's staff; many programmers keep copies of useful boilerplate for common needs.
However, once a framework is learned, future projects can be faster and easier to complete; the concept of a framework is to make a one-size-fits-all solution set, and with familiarity, code production should logically rise. There are no such claims made about the size of the code eventually bundled with the output product, nor its relative efficiency and conciseness. Using any library solution necessarily pulls in extras and unused extraneous assets unless the software is a compiler-object linker making a tight (small, wholly controlled, and specified) executable module.
The issue continues, but a decade-plus of industry experience has shown that the most effective frameworks turn out to be those that evolve from re-factoring the common code of the enterprise, instead of using a generic "one-size-fits-all" framework developed by third-parties for general purposes. An example of that would be how the user interface in such an application package as an office suite grows to have common look, feel and data sharing attributes and methods as the once disparate bundled applications grow unified; hopefully a suite which is tighter and smaller as the newer evolved one can be a product sharing integral utility libraries and user interfaces.
This trend in the controversy brings up an important issue about frameworks. Creating a framework that is elegant, versus one that merely solves a problem, is still an art rather than a science. "Software elegance
Elegance
Elegance is a synonym for beauty that has come to acquire the additional connotations of unusual effectiveness and simplicity. It is frequently used as a standard of tastefulness particularly in the areas of visual design, decoration, the sciences, and the esthetics of mathematics...
" implies clarity, conciseness, and little waste (extra or extraneous functionality, much of which is user defined). For those frameworks that generate code, for example, "elegance" would imply the creation of code that is clean and comprehensible to a reasonably knowledgeable programmer (and which is therefore readily modifiable), versus one that merely generates correct code. The elegance issue is why relatively few software frameworks have stood the test of time: the best frameworks have been able to evolve gracefully as the underlying technology on which they were built advanced. Even there, having evolved, many such packages will retain legacy capabilities bloating the final software as otherwise replaced methods have been retained in parallel with the newer methods.
Examples
Software frameworks typically contain considerable housekeeping and utility code in order to help bootstrap user applications, but generally focus on specific problem domains, such as:- Artistic drawing, music composition, and mechanical CAD
- CompilerCompilerA compiler is a computer program that transforms source code written in a programming language into another computer language...
s for different programming languageProgramming languageA programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....
s and target machines. - Financial modeling applications
- Earth system modeling applications
- Decision support systems
- Media playback and authoringMultimedia frameworkA multimedia framework is a software framework that handles media on a computer and through a network. A good multimedia framework offers an intuitive API and a modular architecture to easily add support for new audio, video and container formats and transmission protocols...
- Web applicationsWeb application frameworkA web application framework is a software framework that is designed to support the development of dynamic websites, web applications and web services. The framework aims to alleviate the overhead associated with common activities performed in Web development...
- MiddlewareMiddlewareMiddleware is computer software that connects software components or people and their applications. The software consists of a set of services that allows multiple processes running on one or more machines to interact...
Architecture
According to Pree, software frameworks consist of frozen spots and hot spots. 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. 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
Software architecture
The software architecture of a system is the set of structures needed to reason about the system, which comprise software elements, relations among them, and properties of both...
where application programmers may make adaptations for specific functionality—the hot spots. These hot spots are usually formalized by defining an explicit component Interface, or a defacto interface as defined by some existing component that is being overridden. Without a framework though, "there is no such thing as a component"
In an object-oriented
Object-oriented programming
Object-oriented programming is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction,...
environment, a framework consists of abstract and concrete classes
Class (computer science)
In object-oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable these class instances to have state and behavior...
. Instantiation
Instantiation
Instantiation or instance*Philosophy:*A modern concept similar to participation in classical Platonism, see the Theory of Forms.*The principle of instantiation, the idea that in order for a property to exist, it must be had by some object or substance.*Universal instantiation and existential...
of such a framework consists of composing
Object composition
In computer science, object composition is a way to combine simple objects or data types into more complex ones...
and subclassing the existing classes.
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
Hollywood Principle
In computer programming, the Hollywood principle is stated as "don't call us, we'll call you." It has applications in software engineering; see also implicit invocation for a related architectural principle.-Overview:...
: "Don't call us, we'll call you." 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.
See also
- Application frameworkApplication frameworkIn computer programming, an application framework consists of a software framework used by software developers to implement the standard structure of an application for a specific development environment ....
- Class (computer science)Class (computer science)In object-oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable these class instances to have state and behavior...
- Design pattern (computer science)Design pattern (computer science)In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that...
- Don't repeat yourselfDon't repeat yourselfIn software engineering, Don't Repeat Yourself is a principle of software development aimed at reducing repetition of information of all kinds, especially useful in multi-tier architectures...
- Enterprise Architecture framework
- Implicit invocationImplicit invocationImplicit invocation is a term used by some authors for a style of software architecture in which a system is structured around event handling, using a form of callback...
- Programming paradigmProgramming paradigmA programming paradigm is a fundamental style of computer programming. Paradigms differ in the concepts and abstractions used to represent the elements of a program and the steps that compose a computation A programming paradigm is a fundamental style of computer programming. (Compare with a...
- Web application frameworkWeb application frameworkA web application framework is a software framework that is designed to support the development of dynamic websites, web applications and web services. The framework aims to alleviate the overhead associated with common activities performed in Web development...