Part 1 of this series introduced the Real Estate Assistant, a multichannel (web and WAP) Java servlet application. This article continues the discussion by examining the Java source code, the XSL user interface style sheets, and the XML testing data file. Rather than spend a lot of time analyzing the static structure of the Java source, I'll summarize it briefly and then walk through the code and supporting templates in the context of a user session.
The Java source code is divided into four packages:
Domain classes describe objects in the user's world. In the real estate world (or at least our simplified universe), these objects consist of properties, lots, and addresses. In addition, we have classes for property queries and result sets, and a class that represents a Multiple Listing Service (MLSBusinessObject). The latter will provide access to property data stored in a cross-brokerage repository (an XML test file in our prototype).
The HTTP servlet and a workflow processor are controller classes. The HTTP servlet interfaces with a user's web or mobile browser and invokes workflow methods to satisfy user requests. A workflow class coordinates user interaction with the system.
The view classes consist of WML and HTML viewers that subclass a viewer class. These carry out the task of merging XML data and XSL style sheets to produce markup language for display in the appropriate browser.
Common classes are used by the classes already discussed, and consist of error definitions, configuration data, and XML processing and manipulation classes. A simple XML parsing and element access class is subclassed by a translating class that can convert Java objects to basic (element-only) XML documents and back again.
The following sections look at each package in turn.
The Java source code is documented using Javadoc. For details of classes, attributes, and methods, check out the generated Javadoc.