We can develop applications by without using any framework in java. But the application development is very slow and we can’t get any additional container provided services.
If we used framework then an application development is becomes faster and apart from container services we can get, additional services from the framework. So we used frameworks for the development of Real world Application.
We’ll be covering the following topics in this tutorial:
What is Framework?
A framework collection of services i.e. develop based on core technologies having the ability to generate the common logics of application dynamically. Which can be reused across multiple applications? Based on other application specific logics given by programmer, which provide set of libraries and these libraries are used in order to make an application development faster. A library is nothing but a JAR file it is similar to zip file contains set of java classes.
Framework software simplifies the process of application development for programmer by reduce the overhead jobs such as capture user input or to generate drop down list boxes. It just focuses on the business logic and the presentation layer of the application.
Framework software provides abstraction layer on core technologies and simplifies the process of application development for programmers. Every framework software internally uses certain core technologies but it makes programmer not to worry about core technologies (nothing about abstract layer) while developing framework based software application.
If we develop MVC2 architecture based web application by taking servlet, JSP core technologies then all the logics of all the layers must be developed by the programmers manually from scratch level. If you develop same application by using struts framework then the controller layer indication logic will be generated dynamically and programmers just need to concentrate only on view layer, model layer logic development.
This improves the productivity of web application development.
Frameworks are divided into two types.
1. Non-invasive or Non Intrusive
2. Invasive
Non-invasive framework means it does not force a programmer, to extend and to implement their classes from any predefine class or an interface given by that framework. Invasive framework means it forces the programmer to extend or implement their classes from a predefine class or an interface given by that framework.
For example:
Spring, Hibernate are Non-invasive frameworks.
Where as struts is an invasive framework.
Rules to be followed by frameworks:
1. Every framework is non installable software.
2. Each framework contains a high-level object and it is responsible for creating the remaining low level objects.
3. Each framework application contains atleast on configuration file of the framework.