It may be interesting for you to check the JSXML work that Bill laForge at
OpenGroup is doing (being able to serialize a Bean to XML) at :
http://www.camb.opengroup.org/cgi-bin/mailbox.pl
As for myself, after a lot of thinking about Java/XML serialization I found
that I don't see *real* application for it. It seems evident that
(de-)serialization of state in the "native-Java" way is much more efficient
then in Java-->XML-->Java way. So effectiveness is certainly not an issue
here. On the other hand I don't see a single case where Java/XML
serialization may be required in *homogeneous* Java systems. I want to
stress that when saying that Java/XML serialization seems useless, I mean
exactly the case of *homogeneous* Java systems.
To my mind, the whole problem of Java/XML serialization seems to be wrongly
formulated. The idea of component state specification through meta
information has *much wider scope* and *implications* then just Java/XML
serialization. Component serialization in general (not JavaBean only) can be
specified in XML. This makes a lot of sense to me. Having *general* XML
specification for component state will allow different OO languages/tools
interoperate on different platforms and network nodes.
Java->XML->Java serialization will make sense only when *general meta
component state specification* will be defined universally. In other words
general serialization scheme will look something like :
X-Object\ /Z-Object
\ /
Y-Object ---<Meta-Object (XML)>---X-Object
/ \
Z-Object/ \Y-Object
Where X,Y, and Z are different OO systems with common notion of class/object
as defined by OOP model.
Another interesting issue here is that having component (file, object,
etc..) specification on meta level (XML) will provide for more uniform
run-time service discovery. Here comes component introspecion.
Though component introspection can certainly be done in the "native-Java"
way (java.beans.BeanInfo), the obvious for me advantage of *XML BeanInfo* is
the ability to introspect components described in BeanInfo _markup_ *without
the need to pre-load these components (classes) first*. This means that one
can make decision of component suitability for some task from its markup
only. To make this possible I am working now on BeanInfo markup and
framework for bean introspection from its XML spec.
So my bottom line is :
- Java/XML combination will help a lot for run time service discovery in
dynamic, context-based, component frameworks. (Introspection with XML BeanInfo).
- General markup (based on XML) for the *component state specification* may
be a real break-through for D-O frameworks running across different
platforms (including different OO tools) on network.
All the best,
Dima
-----------------
Dmitri Kondratiev
dima@paragraph.com
102401.2457@compuserve.com
http://www.geocities.com/SiliconValley/Lakes/3767/
tel: 07-095-464-9241