Академический Документы
Профессиональный Документы
Культура Документы
White Papers
Spring
Java/JEE Application
Framework
July 2008
Application
Introduction
This paper describes basic concepts of Spring
Framework. It shows main features and common use
Module Y
of Spring mechanisms.
TCP, pipeline,
Background filesystem JMS,
etc.
Java Language released in 1995 introduced new
application development concept WORA (Write Once, Module X
Run Anywhere). Java based applications were truly DB
JDBC
platform independent but unfortunately in its simplest
form they did not have an application container or what
we can call “application framework”. Experience shows
that there are still business systems working with this Module Z
not so well managed internal architecture.
Lack of integrated application environment (that we Many application’s modules interact using
call “application container”) was filled with Application outdoor mechanisms like database, file system,
Server. different protocols.
INSONO Sp. z o.o. Sp. k. to firma świadcząca usługi w zakresie rozwoju oprogramowania. Jest ona oddziałem niemieckiej firmy INSONO Consulting
GmbH, mającej siedzibę w Eschborn, koło Frankfurtu nad Menem. Do głównych kompetencji Insono nalężą: tworzenie oprogramowania, integracja
systemów, rozwój systemów informatycznych, współpraca (outsourcing) oraz usługi doradcze (consulting IT, audyt informatyczny) 1
Spring Framework
External System DB
JNDI
Security
Transactions
Clustering
EJB & Web Container
Application XYZ
Application Server is a software engine that Spring Framework is much simpler than others
handles most of business logic and data J2EE solutions. Spring allows building applications
access of the application. Typically it from POJO (Plain Old Java Object) and in the
provides a middleware for dependent same time it gives possibility to use more
application intercommunication, centralized sophisticated services like transaction support,
configuration, security, transactions, etc. database access, security. Spring core feature like
Application Server term sometimes refers to Dependency Injection makes application’s modules
a J2EE or Java EE 5 application server due more independent from each other. This approach
to success and popularity of Java platform. significantly simplifies a unit testing. Also, by using
Spring test support classes it is possible to made
an integration test with ease.
2
Spring Framework
DAO
AOP Data Access Object module gives a JDBC-
(Spring AOP and
abstraction layer that (from developer point of view)
AspectJ)
is database vendor independent.
WEB
3
Spring Framework
mechanism is used implicate to manage Testing
transactions.
Support for broad testing strategies used by
Transactions software developers including unit and integration
tests.
There are two kinds of transactions supported by
Spring: global (JTA, managed by server) and local Examples
(used by JDBC interface, Hibernate, JDO). Spring
creates an abstraction providing a coherent and
Basic use of Dependency Injection:
declarative transaction model.
1. “MyService” is a POJO service providing some
Simplify use of J2EE interfaces
behavior.
Using JNDI, JTA or EJB is simplified by eliminating
2. “MyBean” is a POJO that uses a “MyService”
code duplications (code that do not do any
business logic) like handling exceptions, managing private MyService service;
services context. By that Spring let developers to public MyService getService() {
focus on essential application code. return service;}
public void setService(MyService
Remote Object Call service) {this.service = service;}
Spring allows to remote call POJOs using protocols 3. Application context defined in XML file contains a
like RMI, IIOP, Hessian or Burlap. myService and myBean beans definitions:
4
Spring Framework
<property name="interceptorNames"> introduced a brand new approach to build business
<list> systems where term “enterprise application” does
<idref bean="myInterceptor" /> not have to mean “heavy” (when using Application
</list>
</property> Server) - Spring shows that “enterprise application”
can mean: lightweight, simple and smart. In Insono,
Every method of bean1 and bean2 will be Spring Framework is a standard for creating
intercepted and logic from myInterceptor will be advanced, business applications beside the newest
executed before and/or after method invocation. EJB specification in version 3.0.
Spring Framework because of its popularity has a Rod Johnson, Juergen Hoeller, Alef Arendsen,
number of users and contributors. It is easy to find Thomas Risberg, Colin Sampaleanu – “Spring
solutions and answers over Internet describing Framework”, Helion 2006
Spring features with some examples. Big
Bruce Tate, Justin Gehtland – “Spring. Zapiski
community makes a development process even
Programisty”, Helion 2006
more efficient.
Comparing Web Frameworks
Conclusion https://equinox.dev.java.net/framework-
comparison/WebFrameworks.pdf
Spring Framework provides a support for all Common used frameworks - mailing list analysis
business applications layers additionally it http://raibledesigns.com/rd/entry/spring_mvc_the_
integrates with other single-layer frameworks like most_popular
Struts or Hibernate. Spring let developers to take
benefits from J2EE key solutions (JMS, JPA) at the Spring Framework Introduction
same time Spring minimize complexity of http://static.springframework.org/spring/docs/2.0.x/r
applications. Spring Framework can be used to eference/introduction.html
build not only an enterprise applications but rich
client applications too (see Spring Rich Client
Project). We would say that there is no such
framework that Spring could be compared with. It