James (et al),
I have been looking at the bean handling mechanism and I can't see how the
current implementation can work in a generic manner, so I am probably
missing something, but anyway ..
I can see that the classes appear to be work in progress, but the mechanism
allows for the properties of a bean to be mapped as attributes only, which
gives me some problems
1. If the property is not a string property then a getValue /setValue pair
will not work as there is no code to map do the reverse of the toString()
2. There is no way to do map a structure as an object tree
Is it proposed that the current implementation would evolve to handle
element structures, or is there a proposal to generate an additional package
for this case.
I would hope that there could be a general purpose mechanism to allow for
the duality of an XML based structure and a object structure, and a set of
rules to allow for the mapping of them, without requiring anything on the
target bean.
For example
1. primitives ( and maybe some other simple cases such as Number) mapped as
attributes ( thus allowing for getValue/setValue to work)
2. other property types mapped as elements
3. ability to specify ( ?via an XML doc) the mapping for attributes and
elements
4. if the object itself is an Element, then behaviour should be delegated to
the Element
5. Some rules would be required to cope with mapping for the constructors,
but calling the default constructor should be OK for most circumstances
6. specific mechanisms would have to be in place to cope with cyclic object
structures, but the marshalling/unmarshalling mechanism could use ID/IDREF
This would allow for serialisation of (bean) object structures to / from XML
to be trivial. It could also allow for the manipulation of bean to be done
via XSLT, and other transformation mechanisms.
This should allow for the data to be transformed to/from presentation, where
the presentation form is itself a object model, as an analogy to the HTML
XSLT presentation mechanism.
Similar advantages would appertain to the storage of information, and the
mapping of the object model to/from relational databases
I must be missing something. It sounds to good. Can someone tell me what the
flaw in my thinking is
I would be happy to do some implementation
Mike Skells
_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dom4j-dev