Spring Framework is application framework that provides comprehensive infrastructure support for developing Java Enterprise applications as well as robust/High end web applications. Spring handles the infrastructure so you can focus on your application.
It enables you to build applications from "Plain Old Java Objects" (POJO's) and to apply enterprise services non-invasively to POJO's. This capability applies to the Java SE programming model and to Java EE.
Advantages of using Spring Framework :
- Without having to deal with transaction APIs, A Java method execute in a database transaction .
- A local Java method can be remote procedure without having to deal with remote APIs.
- Make a local Java method a management operation without having to deal with JMX APIs.
- Java method can be a message handler without having to deal with JMS APIs.
Architecture & Modules:
The Spring Framework features organised into 20 about modules. These modules are grouped into Core container , Data Access/Integration, Web, AOP(Aspect Oriented Programming) , Instrumentation, and Test as given in the below diagram.
Core Container :
It has four modules as Core, Beans, Context, Expression Language(EL).
Core : It provides the fundamental features of the framework such IoC and Dependancy injection features.
Bean: It provides BeanFactory which is an implementation of the factory pattern.
Context: It builds on the solid base provided by the core and Beans Modules,It is a means to access objects in a framework style manner similar to JNDI Registry.It supports internationalization (I18N), EJB, JMS, Basic Remoting.
Expression Language(EL) : It provides a powerful expression language for querying and manipulating an object graph at runtime.It provides support to setting and getting property values, method invocation, accessing collections and indexers, named variables, logical and arithmetic operators, retrieval of objects by name etc.
Data Access/Integration:
It comprises of JDBC, ORM, OXM, JMS and Transaction modules. These modules basically provide support for interaction with the databases.
JDBC(Java Database Connectivity): It gives a JDBC-abstraction layer that removes the need to do monotonous JDBC related coding.
ORM(Object Relational Mapping): It gives integration layers for mostly used object-relational mapping APIs such as JPA, JDO, Hibernate, and iBatis.
OXM(Object/XML Mapping): It gives an abstraction layer that supports Object/XML mapping implementations for JAXB, Castor, XMLBeans, JiBX and XStream.
JMS(Java Messaging Service): It gives all the features for producing and consuming messages using Websphere MQ or any other middleware.
Spring Web:
It has four modules likes Web, Servlets , Portlet, WebsocketWeb: Provides support for features like file multipart file-upload functionality , the initialization of the IoC container using servlet listeners and a web-oriented application context.
Servlet: It is also know as spring mvc and has Spring's model-view-controller (MVC) implementation for web applications.
Portlet: Provides the MVC implementation for Spring based Portlets
Web-Socket: Provides support for WebSocket, two-way communication between client and server in web applications.
Also Spring has some important modules like AOP (Aspect Oriented Programming), Aspects, Instrumentation, Messaging.
AOP( Aspect Oriented Programming): Aspect Oriented Programming is sensibly new and it is not a replacement for Object Oriented Programming. AOP is another way of organizing your Program Structure. AOP is a Prominently used for separating crosscutting concerns like logging.
Test: This module helps in Testing purpose of the application. It supports unit testing and integration testing with other framework like jUnit and TestNG.
0 on: "Spring Framework Architecture"