Thursday, October 9, 2008

Spring Framework: Introduction

This is a quick introductory tutorial to the Spring framework and their Architecture. It is intended for people starting out with understanding the Spring modules.

Introduction:

• Spring is a modular Java/J2EE application framework.

• Spring is an open source light-weight framework to address the complexity of any enterprise application development.

• Spring is a well organized and layered architecture with pre-defined modules that can work independently or in combination, providing a framework for J2EE application development allowing us to use only components that are needed.

• Spring can be used with any J2EE server. Primary focus of Spring is to allow reuse of business and data access objects across J2EE environments, Standalone environments, test environments etc without being tied up with just J2EE services.

Spring Framework Architecture:

Following are the various modules of Spring Framework Architecture



Spring CORE:

• Spring Core is the core container for the entire Spring framework providing the base essential functionality features like dependency injection.

• Primary component of the core container is the “Bean Factory”, an implementation of factory pattern to instantiate bean creation. It applies the Inversion of Control (IoC) pattern to separate application’s configuration and dependency specification from actual code.

• It includes supporting utilities and bean container.

Spring CONTEXT:

• Spring Context is a configuration file providing context information to the Spring framework.

• It provides API for obtaining message resources.

• It includes enterprise services like JNDI access, i18n support, EJB integration, remodeling email, UI validation and scheduling functionality.

Spring DAO:

• Spring Data Access Object (DAO) is an abstraction layer providing meaningful exception hierarchy for managing database connection, exception handling and errors thrown by different database vendors.

• It reduces the amount of code one need to write, such as opening and closing connections.

• It includes transaction infrastructure, JDBC support and DAO support.

Spring ORM:

• Spring Object Relational Mapping (ORM) is an interfacing layer providing support for most ORM framework.

• It includes integration support for Hibernate, iBATIS SQL Maps, JDO, JPA, TopLink etc.

Spring AOP:

• Spring Aspect Oriented Programming (AOP) which is fully integrated with Spring configuration management allows to enable AOP features to any objects managed by the Spring framework and incorporates declarative transaction management into your application especially without EJB.

• It includes run time support for the cross-cutting behavior called “aspects” through its meta-data programming that adds annotations to the source code which instructs Spring in applying aspects across multiple components in a system thus complementing OOP with AOP model.

Spring WEB:

• Spring Web is built on top of the Spring Context module providing context for web based applications.

• It includes integration support with various (Model-View-Controller) MVC frameworks like Struts, JSF and web works etc.

Spring WEB MVC:

• Spring Web MVC is a full-featured MVC implementation for building web applications which is highly configurable.

• It includes support for multiple view technologies like JSP, velocity, Tiles, POI, iText etc.

Reference Links:

Spring, one of the leading platform to build and run Enterprise Java
http://www.springframework.org/

No comments:

Post a Comment