· Spring is a open source framework which is implemented by Rod Johnson.
· Spring was created with a very specific goal in mind—to make developing JEE applications easier.
· Spring is a lightweight, dependency injection, aspect-oriented, container and framework.
Lightweight :- Spring is lightweight in terms of both size and overhead. Spring
Framework comes in a single JAR file and is just 2.5 MB . The processing
overhead required is negligible. Spring is also noninvasive. It is lightweight
when we compare it with EJB which needs application server.
Dependency Injection or Inversion Of Control (DI or IOC):-
DI is JNDI in reverse—instead of an object looking up dependencies from a
container, the container gives the dependencies to the object at instantiation. If
you want to call any business functionality you need to create instance for the
required component and sometimes you need to look up registry for some
other component. To eliminate this spring offers Inversion Of Control (IOC)
where spring container is responsible to create and inject the required
instances. Spring container is responsible to create the bean instances and also
responsible to associate the dependencies. The main advantage of DI is loose
Aspect Oriented (AOP ):- This is a type of programming where we can
separate or isolate application business logic from commonly required middle
level services (cross cutting concerns) like security, transaction, logging, etc.
The commonly required services code can be centralized / modularized and
can be reused at various places. The main advantage of this is loose coupling
and reduces maintenance. We use Spring AOP to provide declarative services
like transactions, security and caching.
Container:- Spring is responsible to create instances, invoke life cycle methods,
manage the lifecycle of the objects and also provide the dependency injection
i.e. associate the dependencies between the beans.
Ø Framework:- Spring also provides the support for Events and Listeners,
resolving message bundles (i18n), property editors and configuring properties,
etc. Apart from this Spring also provides various services like transaction
management, security management, persistence framework integration, JNDI
lookup, Javamail, remoting etc by integrating with various service technologies.