Java Reference
In-Depth Information
14.1.3
Cart
The
cart
will be used to maintain a user's product selections. The cart should tally
up the current items that are in the cart in preparation for the order.
14.1.4
Order
The
order
portion of the application will be used for checkout. Once the customer
has made all of their item selections and wants to purchase the items, they will
select checkout from the cart. The cart will take them through a process of confir-
mation, payment, billing, shipping, and final confirmation. Once the order is
completed, it will be viewable by the user in their order history.
14.2 Choosing technologies
Now that we have derived some perspective on our requirements, we need to
make some decisions about what technologies we will use to meet the required
functionality. Since this is a web application, we will look at options for different
layers. The standard web application can be broken into a few pieces:
The presentation layer, the portion of the application that is web specific
■
The service layer, where most of our business rules will exist
■
The persistence layer, where we will deal with elements specific to database
access
■
14.2.1
Presentation
For the presentation layer we have several options. Some of the top frameworks
are Struts,
JSF
, Spring, and WebWork. All of these frameworks have their evange-
lists and are known to perform well in their own right. Out of all of these we
choose to use Struts. Struts is stable and predictable, continues to be progressive,
and is very much alive for both new and existing applications. From this point on
we will assume that you have a moderate understanding of the Struts framework.
If you don't, then
Struts in Action
by
Ted N. Husted, Cedric Dumoulin, George
Franciscus, and David Winterfeldt (Manning, 2002) is an excellent resource.
14.2.2
Service
The service layer will be pretty straightforward. Since this is a topic about i
BATIS
,
we will utilize the i
BATIS
DAO
within the service classes. The i
BATIS
DAO
will be
used to retrieve and store the data access object instances as instance variables on
the service classes. This will allow us to hide the
DAO
implementation from the



