[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    XML Object Example
From:       "Darrell Teague" <darrell.teague () cox ! net>
Date:       2003-08-21 18:39:25
[Download RAW message or body]


(Company mail server having problems so if you had replied, please reply to
this address...)

Hello.

As a follow-on to my previous message offering my services (if desired) for
the XML Beans project, I am attaching a sample set of classes that may
provide some ideas on how XML Beans might be manifested after schema
parsing.  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 an immutable
content 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 part of a node/element 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 using some models
(namely JDOM) directly 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.  In the attached MetaElement class (an instance of
which is a member of the XMLDate class), you will see a possible
implementation of how to utilize good libraries like JDOM without
compromising good o-o practices.

Anyway, I would be glad to help with the XML Beans project - just let me
know if you are interested.  Thanks.

Darrell Teague
757.478.8648 (m)

["XMLDate.java" (application/octet-stream)]
["MetaElement.java" (application/octet-stream)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic