Enhance your career with spring framework Online training which helps you in mastering the real-world web applications with spring. Enroll in this course to get spring certified.
2. Topics Covered
1.What is Spring Framework ?
2. Evolution of Spring Framework
3. Features
4. Architecture of Spring Framework
5. MVC Architecture
6. Advantages and Disadvantages
3. What is Spring
Framework ?
Spring is a lightweight framework. It is an open-source Java Platform which is
used for developing robust Java applications very rapidly and easily. Its
support is extended to various frameworks such as Struts, Hibernate, EJB, JSF,
etc.
4. Evolution of Spring Framework?
Spring Framework was initially developed by Rod Johnson in June 2003. It was first
released under the license of Apache 2.0 in the year of 2004. JavaEE application
development is made easier by the Spring Framework. XML namespaces and AspectJ
support are provided in spring 2.o, Spring 2.5 version provides annotation-driven
configuration, Java-based @Configuration model comes under in the version of spring
3.o. With the support for Java 8 and Java EE7 technologies, the latest version of spring
framework 4.o was released. When it comes to size and transparency spring framework is
lightweight and weighs around 2 MB
5. Features of
Spring Framework ?
• POJO Based
• Modular
• Integration with existing frameworks
• Testability
• Web MVC
• Central Exception Handling
• Lightweight Transaction management
6. Spring Framework Architecture
The Spring Framework consists of seven modules which are shown in the below
Figure. They are named as Spring Core, Spring AOP, Spring Web MVC, Spring DAO,
Spring ORM, Spring context, and Spring Web Flow. Each module provides different
platforms to develop different enterprise applications such as your Spring Web MVC
module is used for developing MVC-based applications.
7.
8. 1. Spring Core Module:
The Spring Core module is the core component of the spring framework, that provides the IoCcontainer .The Spring
container is classified into two types of implementations named as
1.
2.
Bean factory
Application context.
Bean Factory interface acts as a container for beans. It also configures and assem bles the dependencies between these objects. The
most common implementation of the Bean Factory interface is the XML bean factory class. That allows you to express the object to
compose your application and remove the interdependencies between application objects.
2. Spring AOP Module:
Spring AOP module and Object-Oriented Programming (OOP), both are similar, in which they split down the applications into a
hierarchy of objects, AOP splits down the programs into aspects. The aspects in Spring AOP, are the regular classes annotated with
@Aspect annotation. These aspects help in transaction management and logging and failure monitoring of an application. For
example, bank operations such as transferring an amount from one account to another transaction management are required.
3. Spring ORM Module:
For accessing the data from databases in an application the Spring ORM module is used. Spring ORM supports DAO, which provides
an easy way to build the DAOs-based ORM solutions that are mentioned below:
• Simple declarative transaction management
• Transparent exception handling
• Thread-safe, lightweight template classes
• DAO support classes
• Resource management
9. 4. Spring Web MVC Module:
The Web MVC module is used for creating Web applications. The Spring Web MVC module separates the code of model and view
components of a Web application. In Spring MVC, when a request is generated from the browser, firstly it goes to the Dispatcher
Servlet class (Front Controller), that dispatches the request to a controller (Simple Form Controller class or Abstract Wizard form
Controller class) using a set of handler mappings. The controller extracts and processes the information embedded in a request and
sends it to the result to the Front controller in the form of the model object.
5. Spring Web Flow Module:
This module is an extension of the Spring Web MVC module. Spring Web MVC framework provides form controllers, such as class
Simple Form Controller and Abstract Wizard Form Controller class, to implement predefined workflow. The Spring Web Flow defines
the XML file that manages the workflow between different pages of a Web application.
6. Spring Web DAO Module:
The DAO package provides DAO support by using data access technologies such as JDBC, Hibernate, or JDO. This module introduces
a JDBC abstraction layer by eliminating the need for providing tedious JDBC coding. It also provides programmatic as well as
declarative transaction management classes. Heterogeneous Java Database Connectivity and O/R mapping help Spring to
work with several data access technologies.
7. Spring Application Context Module:
Application Context is an interface of Bean Factory. It is based on the Core module. It also implements the Message Source interface
and provides the messaging functionality to an application.
10. MVC Architecture
It is a Java framework that is used to build web applications. It follows the Model-View-Controller
design pattern. All the basic features of a core spring framework are implemented by it.
11. a. Model
It contains the data of the application. Data can be a single object or a collection of objects.
b. Controller
It contains the business logic of an application. Here, the @Controller annotation is used to
mark the class as the controller.
c. View
A view represents the provided information in a particular format. Generally, JSP+JSTL is used
to create a view page. Although spring also supports other view technologies such as Apache
Velocity, Thyme leaf, and Free Marker.
12. Advantages Disadvantages
1. Use of POJO
2. Ease of Testability
3. Inversion control and API’s
4. Well designed Web-
Framework
5. No need to be Reinvent
6. No needof Server
1.Complexity of spring
2. High Learning curve
3. Tons of parallel mechanisms
4. Lots of XML in spring
5. Lack of Guidelines.