Java Reference
In-Depth Information
The application consists of the web-based presentation tier, the business tier, and
the persistence tier. The web-based presentation tier handles HTTP requests and
generates HTML for regular browser clients and XML and other content for rich
Internet clients, such as Ajax-based clients. The business tier, which is invoked by
the presentation tier, implements the application's business logic. The persistence
tier is used by the business tier to access external data sources such as databases
and other applications.
The design of the presentation tier is outside the scope of this topic, but let's
look at the rest of the diagram. We need to decide the structure of the business
tier and the interface that it exposes to the presentation tier and its other clients.
We also need to decide how the persistence tier accesses databases, which is the
main source of data for many applications. We must also decide how to handle
concurrency in short transactions and long-running transactions. That adds up to
five decisions that any designer/architect must make and that any developer must
know in order to understand the big picture.
These decisions determine key characteristics of the design of the application's
business and the persistence tiers. There are, of course, many other important
decisions that you must make—such as how to handle transactions, security, and
caching and how to assemble the application—but as you will see later in this
book, answering those five questions often addresses these other issues as well.
Each of the five decisions shown in figure 2.1 has multiple options. For exam-
ple, in chapter 1 you saw two different options for three of these decisions. The
EJB -based design, which was described in section 1.1, consisted of procedural
code implemented by a session bean and used JDBC to access the database. In
comparison, the POJO -based design, which was described in section 1.2, consisted
of an object model, which was mapped to the database using JDO and was encap-
sulated with a POJO façade that used Spring for transaction management.
Each option has benefits and drawbacks that determine its applicability to a
given situation. As you will see in this chapter, each one makes different trade-offs
in terms of one or more areas, including functionality, ease of development, main-
tainability, and usability. Even though I'm a big fan of the POJO approach, it is
important to know these benefits and drawbacks so that you can make the best
choices for your application.
Let's now take a brief look at each decision and its options.
 
Search WWH ::




Custom Search