Java Reference
In-Depth Information
1.1.3. Layered architectures and EJB
Enterprise applications are designed to solve a unique type of problem and therefore share
many common requirements. Most Enterprise applications have some kind of user inter-
face, implement business processes, model a problem domain, and save data into a data-
base. Because of these shared requirements, you can follow a common architecture or
design principle for building Enterprise applications known as patterns .
For server-side development, the dominant pattern is layered architectures . In a layered
architecture, components are grouped into tiers. Each tier in the application has a well-
defined purpose, like a section of a factory assembly line. Each section of the assembly
line performs its designated task and passes the remaining work down the line. In layered
architectures, each layer delegates work to a layer underneath it.
EJB recognizes this fact and thus isn't a jack-of-all-trades, master-of-none component
model. Rather, EJB is a specialist component model that fits a specific purpose in layered
architectures. Layered architectures come in two predominant flavors: traditional four-tier
architectures and domain-driven design (DDD). Let's take a look at each of these architec-
tures and where EJB is designed to fit in them.
Traditional four-tier layered architecture
Figure 1.1 shows the traditional four-tier server architecture. This architecture is pretty in-
tuitive and enjoys a good amount of popularity. In this architecture, the presentation layer
is responsible for rendering the graphical user interface (GUI) and handling user input. The
presentation layer passes down each request for application functionality to the business
logic layer. The business logic layer is the heart of the application and contains workflow
and processing logic. In other words, business logic-layer components model distinct ac-
tions or processes that the application can perform, such as billing, search, ordering, and
user account maintenance. The business logic layer retrieves data from and saves data into
the database by utilizing the persistence tier. The persistence layer provides a high-level
object-oriented (OO) abstraction over the database layer. The database layer typically con-
sists of a relational database management system (RDBMS) like Oracle database, DB2
database, or SQL Server database.
Search WWH ::




Custom Search