Background :
Spring is an open-source application framework, introduced and developed in 2004. The main ideas were suggested by an experienced J2EE architect, Rod Johnson. He had earlier, written a book titled J2EE Development without using EJB and had introduced the concept of Light-weight container. Primarily, his argument is that while EJB has its merits, it is not always necessary and suitable in all applications.
Just as Hibernate attacked CMP as primitive ORM technology, Spring attacked EJB as unduly complicated and not susceptible to unit-testing. Instead of EJB, Spring suggests that we make use of ordinary Java beans, with some slight modifications, to get all the supposed advantages of EJB environment. Thus, Spring is posed as an alternative to EJB essentially. However, as a concession to the existing EJB investments, Spring is designed to operate with EJB if required.

Much of the philosophy and approach of Spring framework, however, predates, the latest EJB-3. As we know now that EJB-3 has absorbed a number of new ideas suggested by Spring and some more, to answer the criticisms. Their is a debate going on in the Java community about Spring and EJB-3. Spring is not a Persistence technology but a framework which allows plug in of other such technologies. But EJB-3 is primarily focused on Persistence Technology and has now incorporated Hibernate, the best ORM to date.Talks are going on to incorporate another equally nice ORM Technology known as JDO, which provides for Object Database also. Moreover, EJB-3 's Attribute-Oriented Meta tags, help in vastly reducing the size of XML lines. Some have complained that Spring is still too dependent on XML files.
The main aim of Spring is to simplify the J2EE development and testing.


Spring Under The Hood :

Enterprise, Technlogy, Spring Framework, J2EE Development, Hibernate,without EJB
Spring is a great framework for development of Enterprise applications. It is a light-weight framework for the development of enterprise-ready applications. Spring can be used to configure declarative transaction management, remote access to your logic using RMI or web services, mailing facilities and various options in persisting your data to a database. It can be used in modular fashion, allows to use in parts and leave the other components which is not required by the application.

Main Features of Spring Framework:

Transaction Management: Spring framework provides a generic abstraction layer for transaction management. This allowing the developer to add the pluggable transaction managers, and making it easy to demarcate transactions without dealing with low-level issues. Spring's transaction support is not tied to J2EE environments and it can be also used in container less environments.

JDBC Exception Handling: The JDBC abstraction layer of the Spring offers a meaningful exception hierarchy, which simplifies the error handling strategy

Integration with Hibernate, JDO, and iBATIS: Spring provides best Integration services with Hibernate, JDO and iBATIS.

AOP Framework: Spring is one of the best AOP framework

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.
But other frameworks can be easily used instead of Spring MVC Framework..

Spring Architecture :
Spring is well-organized architecture consisting of various modules. Modules in the Spring framework are:

1. Spring Aspect Oriented Programming (AOP)
AOP is used in Spring

a) To provide declarative enterprise services, especially as a replacement for EJB declarative services. The most important such service is declarative transaction management, which builds on Spring's transaction abstraction.

b) To allow users to implement custom aspects, complementing their use of OOP with AOP

2. Spring ORM
The ORM package is related to the database access. It provides integration layers for popular object-relational mapping APIs, including JDO, Hibernate and iBatis.

3. Spring Context
This package builds on the beans package to add support for message sources and for the Observer design pattern, and the ability for application objects to obtain resources using a consistent API.

4. Spring Web
The Web context module builds on top of the application context module, providing contexts for Web-based applications. As a result, the Spring framework supports integration with Jakarta Struts, JSF and webworks. The Web module also eases the tasks of handling multi part requests and binding request parameters to domain objects.

5. Spring DAO
The Spring's JDBC and DAO abstraction layer offers a meaningful exception hierarchy for managing the database connection, exception handling and error messages thrown by different database vendors. The exception hierarchy simplifies error handling and greatly reduces the amount of code that we need to write, such as opening and closing connections. This module also provide transaction management services for objects in a spring application.


6. Spring Web MVC
The MVC framework is a full-featured MVC implementation for building Web applications. The MVC framework is highly configurable via strategy interfaces and accommodates numerous view technologies including JSP, Velocity, Tiles and the generation of PDF and Excel Files.

7. Spring Core
The Core package is the most import component of the Spring Framework.
This component provides the Dependency Injection features. The BeanFactory provides a factory pattern which separates the dependencies like initialization, creation and access of the objects from your actual program logic.
NB: Image sourced from Google Images


Other useful tips on J2EE

Del.icio.us Digg! My StumbleUpon Page