Java Tutorial - Java Scipt : Zeus

Java Tutorial - Java Scipt :

Zeus

Zeus is part of the Enhydra project and is a tool for binding Java objects to their XML equivalents. This makes working with XML documents as simple as working with a Java object. So, instead of calling oDocument.getElement ( “line_item” ), now you can write the code as orderObject.get- LineItem(). This is more natural Java code. See the following table for a summary of Zeus.

Through the use of binding constraints and rules, the underlying XML can change without breaking the Java code. Only the binding constraints and rules need to be updated to accommodate the new format of the bound XML document.

Zeus generates the source code from a description of constraints upon the XML document. Normally, this constraints file will be in the form of a DTD (document type description) or an XML schema that describes the form of an XML document. Each element in the constraints file is mapped to an object by
the source generator. The object will be represented by two files, a Java file that holds the object’s interface and another containing implementation for that class. You can then use the generated Java source files within your own code.

Zeus is a nice tool, but Castor is a better choice for Java to XML binding. Requiring the preprocessing step complicates the build process and makes it more difficult to maintain the source in the long run if the mapping changes. Overall, Zeus builds on a good idea but its implementation lacks the elegance
and flexibility of Castor’s.