Client-Side Presentation Logic
593
In fact, if we restrict our discussion to a purely Java-based context, the processing and transformation
occurring on the client side will be carried out by application logic written in the Java language. As the
current processing for automatic XSLT transformation on the browsers is rather patchy at this moment, the
client-side processing module is implemented using a Java applet in this context. Appropriately enough, all
of the major mainstream browsers now provide full support for Java applets with most of them at the
JDK 1.1 level. This is certainly sufficient to perform highly sophisticated processing on the client side.
Couple this with the fact that most modern-day client machines are actually quite high-powered (fast
CPUs with lots of memory), there is even more reason to adopt a 'medium weight' client architecture to
offload the processing from the server. The only caveat may be bandwidth restrictions and the presence
of firewalls, especially when the client connects to the server via slow links (such as dialup modems).
This effectively limits the size of the applet that may be downloaded.
When we combine the universal data encapsulation/expression power of XML with the run-anywhere
nature of Java, we have a widely applicable medium weight client architecture that can be deployed in a
very wide variety of design scenarios. The diagram below illustrates the 'medium weight' client in the
Java context. Especially noteworthy is the ability to have custom application logic (in the form of a
downloaded applet) to process XML-based data on the client side.
Client
Application
Logic
Web Browser
HTTP carrying
HTML
and/or XML Data
XML
XML
Parser
Applet
Logic
XML
Data
Java VM Hosting Applet
In this chapter, our focus is on these client designs designs that involve significant processing and
presentation logic on the client side. Through the analysis of a case study, we will see:
q
Why client-side processing is often a good idea in real-world application problem solving
q
The various technologies that enable client-side XML processing
q
When it may be appropriate to apply each of the client-side processing technologies
q
What is involved in enabling client-side XML processing