You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-dev@xml.apache.org by Darrell Teague <da...@mantech.com> on 2003/08/21 14:40:26 UTC
XML Object Example
Hello.
As a follow-on to my previous message offering my services (if desired) for the XML Beans project, I am attaching a sample class that may provide some ideas on how XML Beans could behave. That is, I assume certain properties like object (though not XML tree element meta-data) immutability (after parsing an element from an instance document) are desirable.
This particular XMLDate class is an instance of java.util.Date but with decorations and adaptations to allow it to be created from or mutated into XML. Furthermore, it is a composite object that includes a JDOM element (though any DOM-type model could be used). The intent here is to demonstrate how the object data itself is immutable (Bloch 2002) but yet can be a node on a tree (possibly through the use of some kind of common XMLElement interface that would allow independence from XML API models like JDOM - though I like it). The issue with some models (namely JDOM) is that, for performance reasons (chiefly), they break the "is-a" rule for objects by relying on an inheritance model for extension of the API.
Anyway, I would be glad to help with the XML Beans project - just let me know. Thanks.
Darrell Teague
757.478.8648 (m)