Archive

Archive for the ‘Chapter 2 – Introduction to Spring’ Category

Spring Framework Introduction

November 20, 2009 Leave a comment

 

Chapter 2: Introduction to Spring

 

Spring Framework:

The Spring framework is a comprehensive layered Java/Java EE application platform. It was created to address the complexity of enterprise application development. The Spring Framework takes best practices and design patterns that have been proven over the years, codifies these patterns as first class objects that can be integrated into applications. Spring makes it possible to use plain-vanilla Java Beans (POJOs) to achieve things that were previously only possible with EJBs.

 

Spring includes:

  • An IOC lightweight container
  • AOP functionality
  • Abstraction layer for JDBC / transaction management                    
  • ORM integration layer
  • Web integration layer
  • A flexible MVC web application framework 

 

Spring is not only an application framework, it also serves as a platform for several open source projects that are based on the core Spring Framework project such as Spring IDE, Spring Security, Spring Web Flow, Spring Web Services, Spring Rich Client,  Spring Batch, Spring Modules, Spring Dynamic Modules, Spring Integration, Spring LDAP, Spring JavaConfig, Spring .NET, Spring BeanDoc.

 

Spring’s features:

Framework:

Spring makes it possible to develop and maintain complex applications using simple components. In Spring, application objects are configured declaratively typically in an XML file. Spring also provides much infrastructure functionality (transaction management, integration, etc.), leaving only the development of application logic to you.

 

Lightweight:

Spring is lightweight in terms of both size and overhead. Spring Framework can be distributed in a single JAR file that weighs just over 2.5 MB and the processing overhead required by Spring is negligible. Spring is non intrusive in a way that the objects in a Spring-enabled application often have no dependencies on Spring-specific classes.

 

Container:

Spring provides a container which contains and manages the lifecycle and configuration of application objects. In Spring, you can declare how each of application objects should be created, how they should be configured, and how they should be associated with each other.

 

Dependency Injection:

Spring promotes loose coupling through dependency injection (DI). When DI is applied, objects are passively given their dependencies instead of looking for dependencies themselves. You can think of DI as JNDI in reverse — instead of an object looking up for dependencies from a container, the container gives the dependencies to the object at its instantiation without waiting to be asked.

 

Aspect-oriented:

Spring comes with rich support for aspect-oriented programming (AOP) that enables separating application business logic from system services (such as auditing, transaction management, logging etc). Application objects do what they’re supposed to do i.e., perform business logic — and nothing more. They are not responsible for or even be aware of other system concerns, such as logging or transactional support.

 

Spring Framework Architecture: Read more…