Java Reference
In-Depth Information
of the server, the username and the password). With this information,
UbiMail can show a list of the messages received by the user, who can select
one of the messages to look at its content.
The UbiMail system must also interact with the user's mail server. The
system specification defines the protocol to be supported, i.e. the standard
Post Office Protocol (POP). UbiMail must be able to access the list of
messages received by the server (in state Email List ) and to retrieve the
contents of each of them (in state Message ). In addition to correctly display-
ing the contents of email messages the system must be able to deal with
standards to embed complex contents in email messages, such as MIME.
16.3.2
Design
This prototype of the UbiMail system behaves like a gateway that converts
the low-level unfriendly POP protocol to a high-level user-friendly HTML
interface. The design can be divided into three parts: the interaction with
the mail server (back end), the interaction with the user (front end), the
conversion and adaptation among the two.
Decision point
How do we implement the back-end mail component?
The implementation of the POP protocol is not difficult but becomes fairly
complex if we want to support the MIME standard as well. For the back end
we decide to use the standard Java extension package javax.mail (see
Sidebar 16.1). This avoids both unnecessary work and possible implemen-
tation mistakes.
Decision point
How do we implement the user interface component?
The user interface consists of a series of linked HTML pages. For each
state in Figure 16.4 there will be one or more pages. The content of the pages
depends on the user and on the information provided by the mail server.
Therefore the pages must be generated dynamically every time they are
requested.
Java supports several methods for dynamic web page generation. The two
most common technologies are Java Servlets and Java Server Pages (JSP)
(Bodoff et al . 2002). Most implementations of these standards internally
convert JSPs into servlets. Thus they can be considered mostly equivalent,
the main difference being the syntax.
 
Search WWH ::




Custom Search