Web Development Technologies
Ragu Bharadwaj, Daylight CIS Inc.
I would like to describe a methodology we are beginning to use at
Daylight for the development of web applications. The key advantages are
total separation of information and presentation. This allows our users
to vary the presentation of any compiled web app that we ship. The method
uses 2 technologies which I will describe.
XML (eXtensible Markup Language)
A way of representing information in a tree-based (or
container-based) scheme. It is similar to how we do so in a TDT (Thor Data
Tree), with the difference that TDTs can have only a couple of levels of
children. In XML this restriction is removed.
An Example:
<label>
<name> John Doe </name>
<address>
<street> 123 Main
Street </street>
<city> AnyTown </city>
<state> NM </state>
<zipcode> 87501 </zipcode>
</address>
<phone> 505-989-1000 </phone>
</label>
__________________________________________________
| <label>
|
| ____________________________________________|
| | <name> John Doe </name>
|
|
|
| ____________________________________________|
| | <address>
|
| | <street> 123 Main
Street </street> |
| | <city> AnyTown
</city>
|
| | <state> NM </state>
|
| | <zipcode> 87501
</zipcode>
|
| | </address>
|
|
|
| ____________________________________________|
| | <phone> 505-989-1000 </phone>
|
|
|
| </label>
|
So what's the big deal:
-
More and more applications are using XML as a format they can read from
and write to. The XML of course has to obey certain rules (for example,
each label tag must have a name tag or the phone tag must only contain
numbers) These rules are encoded in DTDs or Document Type Definitions.
-
What this means is that data transfer between applications is highly eased
with XML.
-
XML is a simple, plain text format very similar to HTML. This makes debugging
code that uses XML very easy.
-
Several open source libraries and tools are available for parsing XML documents.
These tools are very well debugged and optimized both for speed & for
ease of use. Using these tools with XML greatly improves productivity.
Almost every computer language(C++, Perl, Python, Ruby, Java) has such
tools in the open source.
XSLT (eXtensible Stylesheet Language: Transformations)
Given an XML tree, such as say
<label>
<name> John Doe </name>
<address>
<street> 123, Main
Street </street>
<city> AnyTown </city>
<state> NM </state>
<zipcode> 87501 </zipcode>
</address>
<phone> 505-989-1000 </phone>
</label>
typically, one may want to convert it into a printable address label
like:
John Doe,
123, Main Street
Anytown, NM 87501
followed perhaps by a bar code for the same
To do so one could
-
place rules for doing the same in an XSLT file
-
run a program that reads in the XML file for the label and the XSLT file
for conversion
-
apply the conversions read to the XML file read in and produce the output
Advantages:
-
XSLT is simple & easy to learn. As HTML is related to XML, XSLT has
special constructs for outputting HTML
-
A web CGI/app can be delivered in a compiled form with XSLT files that
are plain text. This enables the users to alter the XSLT file independently,
and alter the appearance of the output page without any recompilation (which
would have needed source code)
-
Depending on the invocation context of a CGI/web app, the output can be
-
HTML for a web browser
-
WML for a PDA based platform such as PalmOS
-
PDF
-
an XML format that can be directly imported into Microsoft Office
Web App Design
We plan to use the following scheme
DB -> XML -> XSLT -> HTML, PDF, WML,...
A Web Application will typically
-
query and retrieve information from a database
-
format the retrieved information in generic XML
-
invoke a XSLT parser library, pass it the name of an XSLT file to read
and the XML created
-
the XSLT parser will then read in the XSLT from the XSLT file and
-
transform the passed in XML using the rules mentioned in the XSLT file
-
output the transformed data
This allows for:
-
content & presentation separation
-
all content is in XML and is retrieved by the web application. Content
is created by a compiled program, optimized for speedy retrieval. For example,
the web application can use pooled Db connections to talk to a database
-
all presentation information is in XSLT. XSLT files are plain text and
can be modified by the end user or administrator. This enables tailoring
output according to one's custom requirements. For example,
-
the corporate logo, with a search date can be inserted into the output.
-
certain irrelevant fields can be deleted from the output.
-
The output can be made to be Microsoft Office compatible
-
The output can be augmented with additional info from other programs
Example apps:
-
Savant:
Spresi Literature Search
-
ReacsSavant:
Chemsynth Reaction Database Literature Search
There are several other web technologies that Daylight may offer
solutions for in the near future.
-
Taglibs in Java (via JSP taglibs), PHP, Ruby & other languages
-
Web Application aRchives (WARs) which are java-based web apps that can
be deployed in any standard Application Server such as BEA Weblogic or
IBM WebSphere.