- The Task: Define a Function and Call It From HTML
- Why should you program in XML?
- Water shares the same syntax as HTML and XML
- Water supports a flexible architecture
- Water Implementation
- JSP Implementation
- Summary
- References and Useful links
1. Water shares the same syntax as HTML and XML.
Web development is unnecessarily complex due to the number of different technologies and languages required to build and deploying Web software. For example programming with JSP, which is only a part of the J2EE platform, requires learning at least four different languages or technologies.
HTML is the base markup language predominately used to create thin-client user interfaces.
JSP tags such as page directives and expressions bridge the HTML and Java languages.
Java is used to implement application flow and business logic
Tag Library Descriptors describe custom JSP tags that call Java functions.
In addition, web programs often require the use of the JavaScript language and the Cascading Style Sheet language. Each language has a different syntax, a different method for creating objects, and different processing rules. Each of these differences makes it challenging to implement even simple programs. Tracking the location of a simple syntax error or debugging an n-tier system is extremely difficult.
For example, a JSP file contains HTML text. The HTML embeds JSP tags, and the JSP tags embed Java code. The Java code can output strings, but not JSP tags. Manipulating HTML and XML typically requires a lot of parsing and string processing. For example, the HTML tags within a JSP file are simple strings and therefore the majority of JSP operations are string-oriented, not object-oriented. On the other hand, Water treats every HTML tag as either a method call or an object constructor. A developer can use the Water debugger to step through nested HTML tags and show HTML tags in the object inspector. Extending the object system to HTML is one of the key simplifications that Water brings to web development.
The Water language is XML-Native; Water's syntax and object system blend seamlessly with HTML and XML. Other programming languages have an object model that makes it difficult to interface to XML. For example, there are at least four officially supported, but incompatible XML interfaces from Sun, as well as many other XML API's from other vendors. The syntax is familiar to most web developers because the Hypertext Markup Language is the most widely used language in the world. Unlike JSP and ASP technologies, which require training in many languages, Water has only a single, simple language to learn.