Spring
Spring
Spring
Spring Framework
enables Plain Old Java Object (POJO) based
programming model
with POJO you don’t need EJB container product
utilizes existing technologies like
ORM frameworks
logging frameworks
JEE
Quartz
JDK timers
Intro to Spring-2
Spring Framework
is a well-designed web model-view-controller (MVC)
framework(a great alternative to Struts)
provides a coherent transaction management interface that be
applicable to a local transactions() local transactions or global
transactions(JTA)
provides a suitable API for translating technology-specific
exceptions ( for instance, thrown by JDBC, Hibernate, or JDO,)
into consistent, unchecked exceptions.
The Inversion of Control (IoC) containers are lightweight,
especially when compared to EJB containers. Being lightweight is
beneficial for developing and deploying applications on computers
with limited resources (RAM&CPU).
Testing is simple because environment-dependent code is moved
into this framework.
What are Beans?
In Spring, POJO’s (plain old java object) are called ‘beans’ and
those objects instantiated, managed, created by Spring IoC
container.
Beans are created with the configuration metadata (XML file) that
we supply to the container.
Bean definition contains configuration metadata. With this
information container knows how to create bean, beans lifecycle,
beans dependencies
After specifying objects of an application, instances of those
objects will be reached by getBean() method.
Spring supports given scope types for beans:
Singleton (a single instance per Spring IoC container (default))
Prototype
Request
Session
Global-session
Scope of Beans
http://www.cs.colorado.edu/~kena/classes/5448/f11/
lectures/30-dependencyinjection.pdf
Spring Framework 3.1 Tutorial
http://courses.coreservlets.com/Course-Materials/
spring.html
http://martinfowler.com/articles/injection.html
Questions/Discussions