Spring is one of the most popular open source framework for developing enterprise applications. It provides comprehensive infrastructure support for developing Java based applications.
Spring also enables the developer to create high performing, reusable, easily testable and loose coupling enterprise Java application.
Key Strategies of Spring :
- Spring is a light weight framework and It minimally invasive development with POJO.
- Spring achieves the loose coupling through dependency injection and interface based programming.
- Spring supports declarative programming through aspects and common conventions.
- Boilerplate reduction through aspects and templates.
Above are the 4 key strategies of spring framework simplifies the development of Java enterprise application.
Advantages of Spring Framework:
The Spring framework addresses most of the infrastructure functionalities of the Enterprise applications. Following are the few major advantages of Spring Framework.
- Spring enables the developers to develop enterprise applications using POJOs (Plain Old Java Object). The benefit of developing the applications using POJO is, that we do not need to have an enterprise container such as an application server but we have the option of using a robust servlet container.
- Spring provides an abstraction layer on existing technologies like servlets, jsps, jdbc, jndi, rmi, jms and Java mail etc., to simplify the develpment process.
- Spring comes with some of the existing technologies like ORM framework, logging framework, J2EE and JDK Timers etc, Hence we don’t need to integrate explicitly those technologies.
- Spring WEB framework has a well-designed web MVC framework, which provides a great alternate to lagacy web framework.
- Spring can eliminate the creation of the singleton and factory classes.
- Spring provides a consistent transaction management interface that can scale down to a local transaction and scale up to global transactions (using JTA).
- Spring framework includes support for managing business objects and exposing their services to the presentation tier components, so that the web and desktop applications can access the same objects.
- Spring framework has taken the best practice that have been proven over the years in several applications and formalized as design patterns.
- Spring application can be used for the development of different kind of applications, like standalone applications, standalone GUI applications, Web applications and applets as well.
- Spring supports both xml and anotation configurations.
- Spring Framework allows to develop standalone, desktop, 2 tire – n-tire architecture and distributed applications.
- Spring gives built in middleware services like Connection pooling, Transaction management and etc.,
- Spring provides a light weight container which can be activaed without using webserver or application server.
And more over the Spring framework consists of features organized into about 20 modules, these modules are grouped into Core Container, Data Access/Integration, Web, AOP (Aspect Oriented Programming ), Instrumentation and Test.
Lets see each module in Spring Framework –
Spring Core Container :
The Spring Core container is the basis for the complete spring framework. The Spring core container provides an implementation for IoC supporting Dependency Injection. The container provides a consistent means of configuring and managing the Java objects using call backs. The container is also responsible for managing the objects life cycle such as
- Creating the Objects
- Calling initialization methods
- Configuring objects by writing them together
Spring AOP (Aspect Oriented Programming) :
Spring AOP module provides an implementation of AOP (Aspect Oriented Programming). The Spring AOP is a proxy-based framework implemented in Java and it is developed based on AOP Alliance API, which enables us to use the advice developed under Spring AOP to be used with other AOP implementations, meaning it allows us to migrate the components implemented using Spring AOP to some other AOP implementation or to integrate any existing AOP alliance complaint component to work with Spring.
Spring JDBC and DAO Module:
The Spring framework supports for DAO includes a consistent exception hierarchy and a convenient translation from data access API-specific exceptions to the Spring DAO exception hierarchy.
The Spring framework provides a solution for the various problems identified by using JDBC as low-level data access API for implementing DAO, by giving thin, robust and highly extensible JDBC abstraction framework.
The ORM (Object Relational Mapping) module for the Spring framework provides a high level abstraction for well-accepted object-relational mapping APIs such as Hibernate, JPA, JDO, OJB and iBatis. The Spring ORM module is not replacing or a competitive for any existing ORMs; instead it is designed to reduce the complexity by boilerplate code from the application in using the ORMs.
J2EE (Java Enterprise Edition):
The JEE module of Spring framework is build on the solid base, provided by the core package. This provides a support for using the remoting services in a simplified manner. This supports to build POJOs and expose them as remote objects without worrying about specific remoting technology given rules.
The Web module of Spring framework includes all the support for developing robust an maintainable web application in a simplified approach. It even includes support for MVC-based applications development.
The above described advantage of spring framework makes the framework to accept the world as Spring is a robust framework.
Happy Learning 🙂