Magazine
 
Spring
 
 

4. Spring ORM package

The ORM package is related to the database access
support. It provides integration layers for popular objectrelational mapping APIs, including JDO, OJB, Hibernate and iBatis SQL Maps.

5. Spring AOP package

One of the key components of Spring is the AOP
package. AOP is used in Spring:

I. To provide declarative enterprise services, especially as a replacement for EJB declarative services. The most
important such service is declarative transaction management, which is build on Spring’s transaction abstraction layer.

II. To allow users to implement custom aspects, complementing their use of OOP with AOP. The Spring AOP module also introduces metadata programming to Spring. This is used to add annotation to the source code that instructs Spring on where and how to apply aspects.

6. Spring Web package

The Spring Web module is a part of Springs web
application development stack, which includes Spring’s
MVC. The Web context module is build at the top of application context module which provides contexts for Web-based applications. As a result, the Spring framework supports integration with Jakarta Struts, JSF and web works. The Web module also eases the tasks of
handling multipart requests and binding request parameters
to domain objects.

7. Spring Web MVC package

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

Main Pillars of Spring :

I. An AOP Framework
II. An Inversion of Control Container
III. A Service Abstraction Layer

 

These together enable to write powerful, scalable applications using the Plain Old Java Objects (POJOs).

I. AOP: Aspect Oriented programming AOP decomposes a system into concerns, instead of objects. It deals with “aspects” that cross-cut across the code which could be difficult or impossible to modularize with OOP.

Aspect Oriented programming is a new programming technique that promotes separation of concerns within the systems. The core construct of AOP is the aspect, which encapsulates behaviors affecting multiple classes into reusable modules. Systems are composed of several components each responsible for a specific piece of functionality. Irrespective of the core functionality of a program, the system services like logging, transaction management, security etc., must be included in the program. These system services are commonly referred to as ‘cross-cutting concerns’ as they tend to cut across multiple components in a system.

AOP makes it possible to modularize and separate these services and then apply them declaratively to the components and we can focus on our own specific concerns. In spring, aspects are wired into objects in the spring XML file in the same way as JavaBean. This process is known as ‘Weaving’.

In a typical object-oriented development approach you might implement logging functionality by putting logger statements in all your methods and Java classes. In an AOP approach you would instead modularize the logging services and apply them declaratively to the components that required logging. The advantage, of course, is that the Java class doesn’t need to know about the existence of the logging service or concern itself with any related code. As a result, application code written using Spring AOP is loosely coupled.

II. IoC: Inversion Of Control

“The IoC pattern enables better software design that
facilitates reuse, loose coupling, and easy testing of
software components.” The basic concept of the Inversion of Control pattern (also known as dependency injection) is that you do not create your objects but describe how they should becreated. You avoid connecting components and services together in your code. Instead a configuration file is used to describe the services needed by a component . In the Spring framework, the IOC container is responsible for looking it all up.

July 2007 | Java Jazz Up |24
 
previous
index
next
 
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 ,            Download PDF