Java Reference
In-Depth Information
Different containers provide different sets of low-level services. The web container
does not provide transactional support, but the EJB container does. These services can be
accessed using standard Java EE APIs such as Java Transaction API ( JTA), Java Message
Service ( JMS), Java Naming and Directory Interface ( JNDI), Java Persistence API ( JPA),
and Java Transaction API ( JTA). The greatest benefit, however, is that these services can
be applied transparently on the application components by mere configuration. To inter-
pose these services, the application components should be packaged in predefined
archive files with specific XML-based deployment descriptors. This effectively helps cut
down on development time and simplifies maintenance.
Java EE Application Architecture
The Java EE platform makes the development of distributed n-tier applications easier.
The application components can be easily divided based on functions and hosted on dif-
ferent tiers. The components on different tiers generally collaborate using an established
architectural principle called MVC.
An MVC Detour
Trygve Reenskaug first described MVC way back in 1979 in a paper called “Applications
Programming in Smalltalk-80™: How to use Model-View-Controller.” It was primarily
devised as a strategy for separating user interface logic from business logic. However,
keeping the two isolated does not serve any useful purpose. It also suggests adding a
layer of indirection to join and mediate between presentation and business logic layers.
This new layer is called the controller layer . Thus, in short, MVC divides an application
into three distinct but collaborating components:
• The model manages the data of the application by applying business rules.
• The view is responsible for displaying the application data and presenting the con-
trol that allows the users to further interact with the system.
• The controller takes care of the mediation between the model and the view.
Search WWH ::

Custom Search