Friday, 24 July 2009

Spring Framework


Spring is standard in lightweight enterprise application framework. Layered architecture, which allows you to be selective about which of its components you use there are seven modules in Spring Frame work
I>  Spring Core:
Uses IOC pattern to separate the application configuration with dependency specification from the actual application code.
IOC (Inversion of control)
  • No creation of object but describe how to create
  • Not connect direct to components
  • Mention in conf file for which service which component
  • org.springframework.beans
Bean Factory
  • org.springframework.beans.factory.BeanFactory
  • Singletone mode: Shared instance
  • Prototype Mode: each retrieval result new object
  • Take care when to create objects and when to invoke the method
Java Beans -  POJO ()
  • No creation of object but describe how to create
II>  Spring Context:
  • Context Information
  • EJB, e-mail, internalization, validation, and scheduling functionality.
III>  Spring AOP (Aspect Oriented Programming):
  • Provides transaction management services for objects
  • Logging (declaratively to the components that required logging.)
IV> Spring DAO (Data Access Object):
  • managing the exception handling
  • error messages
  • opening and closing connections
V > Spring ORM
  • Including JDO, Hibernate, and iBatis SQL Maps.
VI>  Spring Web Module
  • The Web module also eases the tasks of handling multi-part requests and binding request parameters to domain objects.
VII > Spring MVC framework:
  • Numerous view technologies including JSP, Velocity, Tiles

Difference between Struts and Spring


Sl. No
Struts
Spring
1
Struts is a web framework
Spring is an application
framework
2
Using MVC pattern
spring MVC is one of the
modules
3
Hard code to use applications
like hibernate, JDBC
Inbuilt hibernate, JDBC etc
4
Struts allows only JSP
Support JSPs, Velocity,
Free maker etc.,
5
Struts is heavy weight
Spring is light weight
6
Struts is tightly coupled
Spring is loosely coupled.
7
Excellent support for
Tag Library
Not that Much
8
Easy to integrate with other
client side technologies
Not Easy.