Java framework Architecture
A framework is a set of cooperation classes that represent reuseable design of software systems in an application domain. Generlly speaking a framework is made of a set of abstract classes, concrete classes and a set of interfaces.
When building an pplication on top of any application your user defined classes and application add specialization to the framework classes and interfaces. You basiclly add the hooks that will make the application work correctly using the power of the framework.
If and when you decide to build your own framework you need to be aware of the following characteristics of frameworks that must be satisifed before you claim victory:
Your application extends the framework classes and interfaces supplying what’s called hooks for the framework hotspots
for example our applets must provide implementation for init() and start() methods of the JApplet class. Same applies when designing a framework, you need to impoly good object oriented design desicions to be allow building extnesible application on top of the new framework.
- Inversion of Control
The Framework is in charge and not the application. In the above Applet example the control reside in the Applet class.
- Design Patterns should be used as building blocks for the new framework
- Collection Framework (Containers)
The collections framework is a unified architecture for representing and manipulating collections (containers), it represents the different types of collections like lists, link lists, arrays, maps, sets, etc., allowing the containers to be manipulated independently of the details of their representation. It allows for interoperability among unrelated APIs, reduces effort in designing and learning new APIs, and fosters software reuse. The framework is based on fourteen collection interfaces. It includes implementations of these interfaces, and algorithms to manipulate them. A set of classes and interfaces that support storing and retrieving objects in collections of data structures. read more.
Orcle development documentation lists the following benefits of the collection framework:
- Reduces programming effort by providing useful data structures and algorithms so you don't have to write them yourself.
- Increases performance by providing high-performance implementations of useful data structures and algorithms. Because the various implementations of each interface are interchangeable, programs can be easily tuned by switching implementations.
- Provides interoperability between unrelated APIs by establishing a common language to pass collections back and forth.
- Reduces the effort required to learn APIs by eliminating the need to learn multiple ad hoc collection APIs.
- Reduces the effort required to design and implement APIs by eliminating the need to produce ad hoc collections APIs.
- Fosters software reuse by providing a standard interface for collections and algorithms to manipulate them.
- GUI Framework
A set of classes and interfaces that support GUI. AWT and the Swing Packages
- Input/Output Framework
A set of classes and interfaces that support the input and output of different types of objects using different media.