On Tuesday, July 9, 2002, at 11:25  am, Sam Joseph wrote:

>> 2) Generated code either on the objects or the peers which 
>> marshall/unmarshall from XML. I presume the code to do all this exists 
>> since there are Ant tasks which can deal with XML data files for the 
>> object model, but it would be really nice to have a kind of 
>> "Xmlizable" interface which the BaseObjects could implement and 
>> provide toXml() and BaseObject(String xmlIn) methods or similar.
>
> I'd be interested in seeing this functionality too.  Might it be cool 
> to incorporate this:
> http://www.csse.monash.edu.au/~bren/JSX/tech.html

JAX itself seems to be GPL, so incompatible license-wise to actually 
incorporate it.

However, I like the idea of using the Serialization API to support the 
XML serialization. I think the objects created by Torque are not 
Serializable, although I don't see any reason why they couldn't be 
Serializable in the conventional way.

Perhaps the answer then, instead of/or maybe as well as the extra 
methods I suggested, is to use the Serialization API and provide extra 
attributes in the schema i.e
        <database name="mydb" defaultSerialization="java|xml|none" ...
                <table name="mytable" serialization="java|xml|none" ...

"java" would result in the classes implementing "Serializable"
"xml" would result in the classes implementing "Serializable" and 
override "writeObject" and "readObject".
"none" would result in the current behaviour.

To get pure XML serialization you'd still have to have a class which 
overrides ObjectOutputStream and use that when serializing, to avoid 
having class headers and stuff there.

Not sure. Anyone?

Gareth


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to