Spring
Introduction to Spring Framework
1. Spring Framework is one of the most popular Java EE
frameworks.
It is an open source and light weight framework created
by Rod Johnson in June 2003.
2. Spring framework can be used for all layer
implementations for a real time application or spring can be used for the
development of particular layer of a real time application Unlike struts [ only
for front end related ] and hibernate [ only for database related ], but with
spring we can develop all layers.
3. It can be thought of as a framework of frameworks
because it provides support to various frameworks such as Struts, Hibernate,
Tapestry, EJB, JSF etc.
4.Spring framework is said to be a non-invasive means it
doesn’t force a programmer to extend or implement their class from any
predefined class or interface given by Spring API, in struts we used to extend
Action Class right that’s why struts is said to be invasive
5. The Spring framework comprises several modules such as
IOC, AOP, DAO, Context, ORM, WEB MVC etc.
6. Spring having this much of demand because of the
following 3 reasons….
Simplicity
Testability
Loose Coupling
7. Advantages of Spring Framework:
1. Light weight: Spring framework is light weight
framework because of its POJO model implementation.
2. Non-invasive approach: As we know that struts forces
programmer to extend Action Class but spring framework doesn’t force a
programmer to extend class or implement interface given by Spring API.
3. Loose Coupling: Because of dependency injection
concept, spring objects are loosely coupled.
4. Modular fashion: Spring framework is designed in
modular fashion. A programmer can use only needed modules and ignore the rest.
5. Easy Testing: Dependency injection and POJO model
makes easy to test an application.
6. Transaction management interface: Spring framework
provides transaction management interface for transaction management.
7. No need of application server: Struts or EJB
application require application server to run but spring application doesn’t
need an application server.
8. MVC framework: Spring framework is a great alternative
to web MVC frameworks like Struts.
9. Declarative support: It provides declarative support
for caching, validation, transactions and formatting.
10. It provides powerful abstraction to JavaEE
specifications such as JMS, JDBC, JPA and JTA.
11. Fast Development: The Dependency Injection feature of
Spring Framework and it support to various frameworks makes the easy
development of JavaEE application.
12. Predefined Templates: Spring framework provides
templates for JDBC, Hibernate, JPA etc. technologies. So there is no need to
write too much code. It hides the basic steps of these technologies.
Let's take the example of Jdbc Template, you don't need
to write the code for exception handling, creating connection, creating statement,
committing transaction, closing connection etc. You need to write the code of
executing query only. Thus, it saves a lot of JDBC code.
No comments:
Post a Comment