Features of Spring Framework


Spring is both the most popular and most ambitious of the lightweight frameworks. It is the only one to address all architectural tiers of a typical J2EE application, and the only one to offer a comprehensive range of services, as well as a lightweight container. We'll look at Spring's modules in more detail later, but the following are the key Spring modules:
AOP Framework: Spring is the best AOP framework

Integration with Hibernate, JDO, and iBATIS

MVC Framework: Spring comes with MVC web application framework, built on core Spring functionality. This framework is highly configurable via strategy interfaces, and accommodates multiple view technologies like JSP, Velocity, Tiles, iText, and POI.

Inversion of Control container: The core "container" of Spring provides, enabling sophisticated configuration management for POJOs.

The Spring IoC container can manage fine or coarse- grained POJOs (object granularity is a matter for developers, not the framework), and work with other parts of Spring to offer services as well as configuration management. We'll explain IoC and Dependency Injection later.

Aspect-Oriented Programming (AOP) framework: AOP enables behavior that would otherwise be scattered through different methods to be modularized in a single place. Spring uses AOP under the hood to deliver important out-of-the-box services such as declarative transaction management.Spring AOP can also be used to implement custom code that would otherwise be scattered between application classes.
Data access abstraction: Spring encourages a consistent architectural approach to data access, and provides a unique and powerful abstraction to implement it.Spring provides a rich hierarchy of data access exceptions, independent of any particular persistence product. It also provides a range of helper services for leading persistence APIs, enabling developers to write persistence framework–agnostic data access interfaces and implement them with the tool of their choice.

JDBC simplification: Spring is proving an abstraction layer over JDBC that is much more simpler and less error-prone to JDBC when you need to use SQL-based access to relational databases.

Transaction management: Spring provides a abstraction transaction that can be used over a JTA "global" transactions (managed by an application server) or "local" transactions using the JDBC, Hibernate, JDO, or another data access API. This abstraction provides a steady programming model in a wider range of environments.It’s also the basis for Spring's declarative and programmatic transaction management.

MVC web framework: Spring comes with MVC web application framework, built on core Spring functionality. Its use of shared instances of multithreaded "controllers" is similar to the approach of Struts, but Spring's web framework is more flexible, and integrates seamlessly with the Spring IoC container. All other Spring features can also be used with other web frameworks such as Struts or JSF. Also this framework is highly configurable via strategy interfaces, and accommodates multiple view technologies like JSP, Velocity, Tiles, iText, and POI.

Simplification for working with JNDI, JTA, and other J2EE APIs: Spring can help you to remove the need for the verbose, boilerplate code that "doesn't do anything but just sits there." With Spring, you can continue to use EJB or JNDI, if you want, but you'll never have to write another JNDI lookup. Besides, simpler configuration can result in framework performing the lookup on your behalf, assuring you that resources such as JNDI contexts are closed even in the event of an exception. The dividend means that you get to focus on writing code that you need to write, and that relates to your business domain.

Easy and lightweight remoting: Spring provides various support for POJO-based remoting over a range of protocols, including IIOP, RMI, Burlap-Hessian, and other web services protocols that come in handy.

JMX support: Framework supports JMX management of every application objects it configures.

JMS support: This Framework provides support for receiving and sending JMS messages in a much more simple way than provided through standard J2EE.

Support for a comprehensive testing strategy for application developers: Spring not only helps to facilitate good design, allowing effective unit testing, but provides a comprehensive solution for integration testing outside an application server.