The growing heterogeneity of hardware ubuntures and diversity of operating system and communication platforms makes it hard to build correct, portable,
Efficient, and inexpensive applications from scratch.
1. Library vs framework
Frameworks are active and exhibit ''version of control'' at run-time -- class libraries are typically passive, I. E ., they perform their processing by borrowing threads of control from self-directed application objects. in contrast, frameworks are active, I. E ., they control the flow of control within an application via event dispatching patterns like reactor and observer. the ''version of control'' in the run-time architecture of a framework is often referred to as the Hollywood
Principle, I. e., ''don't call us, we'll call you .''
2. IOC: Key of Framework
Inversion of control -- the run-time architecture of a framework is characterized by an ''inversion of control. ''this architecture enables canonical application processing steps to be customized by event handler objects that are invoked via the framework's reactive dispatching mechanism. when events occur, the Framework's dispatcher reacts by invoking hook methods on preregistered handler objects, which perform application-specific processing on the events. inversion of control allows the framework (rather than each application) to determine which set of application-specific methods to invoke in response
External events (such as window messages arriving from end-users or packets arriving on communication ports ).
3. whitebox/blackbox framework
Regardless of their scope, frameworks can also be classified by the techniques used to extend them, which range along a continuum from whitebox frameworks to blackbox frameworks. whitebox frameworks rely heavily on OO language features like inheritance and dynamic binding to achieve extensibilty. existing functionality is reused and extended by (1) inheriting from framework base classes and (2) overriding pre-defined hook methods using patterns like template method [GAMMA: 95]. blackbox frameworks support extensibility by defining interfaces for components that can be plugged into the framework via Object composition. existing functionality is reused by (1) defining components that conform to a participant interface and (2) integrating these components into the framework using patterns like Strategy [GAMMA: 95] And functor.
Whitebox frameworks require application developers to have intimate knowledge of the frameworks' internal structure. although whitebox frameworks are widely used, they tend to produce systems that are tightly coupled to the specific details of the framework's inheritance hierarchies. in contrast, blackbox frameworks are structured using object composition and delegation more than inheritance. as a result, blackbox frameworks are generally easier to use and extend than whitebox frameworks. however, blackbox frameworks are more difficult to develop since they require framework developers to define interfaces and hooks that anticipate a wider range of potential use-cases.
4. object-oriented programming and design: People think concretely, not supported actly. supported actions are found bottom-up, by examining concrete examples.
5. Framework developer or domain expert?
6. The framework works with little or no client code, even if the default implementations are simply placeholders, and it supports small, incremental steps to get from the default behavior to sophisticated solutions.
7. over the lifetime of a framework, the cost of supporting it actually becomes a benefit -- the support cost of one framework with three dependent applications will be less than the cost of supporting three independent applications with duplicate code.
The more applications that use a framework, the bigger the savings. Long term, using frameworks can reduce support and maintenance costs.
Early in its life, a framework will probably require routine maintenance to fix bugs and respond to client requests. Over time, even the best framework will probably need to be updated to support changing requirements.
8. Good Designers know designs patterns and techniques that they know lead to good designs. Applying recurring patterns to the design of
Framework is one form of reuse. Using formalized "design patterns" also helps to document the framework, making it easier for clients to understand, use, and extend the framework.