The client side is AJAX-based and supports client-side custom tags embedded in XHTML. A built-in tag library is provided, with a XUL-like box model and a few widgets like Slider, Splitter, and Calendar.
The server side is servlet-based. The project is a symmetric client/server protocol with XML as the command language, and a shared design concept called tag-oriented programming.
The Tag interface specifies three methods that are invoked during construction of the object structure.
· init(): This is called after the XML start tag has been parsed, the object has been instantiated and attributes have been assigned based on the corresponding XML attributes. The default implementation does nothing.
· apply(): This is called after the XML end tag has been parsed and all nested content has been processed. It is the responsibility of the apply() method to perform the main processing associated with the object which could involve transforming the object into a different object or could involve significant side effects. It is the responsibility of the apply() method to insert the object (or its transform) into its parent object if that is appropriate. The default implementation just adds the object to its parent with no side effects.
· add(): This is used to add an element to the content of a Tag. It is typically called by the apply() method of a potential child Tag. The default implementation adds the object to a list of content elements.
Tag Oriented Programming and AjaxTop can be thought of in serveral ways, depending on what you are looking for.
· A way to read and process XML files:
At one level, Tag Oriented Programming is just a thin layer over the SAX Parser.
· A way to make AJAX a little more user friendly:
There are any number of other packages for handling the messy, low level details of doing AJAX. AjaxTop is unique in that it also deals with the issue of how to organize callbacks and cleanly deal with XML (the A and the X in AJAX).
· Another way to do XML transforms:
XSLT is the standard way to handle XML transforms. Some find it awkward, confusing and limiting. AjaxTop provides a simpler, more procedural, approach to the problem.
· A Web Application Framework:
The recognized way to implement Web Applications with Java uses JSP with Struts or JSF in a complex approach based on the idea of mixing static and dynamic content on the Server. With AJAX, we do not have to do that any more. AjaxTop uses a simple and straight forward approach that makes Web Applications more responsive and reduces the load on the Server.
· A new programming paradigm:
In the tradition of Object Oriented Programming and Structured Programming before it, Tag Oriented Programming represents a slight paradigm shift, but builds on the foundation of the past. It makes a lot of things simpler and easier. Principles developed for one purpose carry over into new, unintended problem domains.
That is all there is to Tag Oriented Programming at the conceptual level. Step through the remaining topics for the details.