You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Paul Tomsic <pt...@yahoo.com> on 2006/04/21 02:37:15 UTC

java to sdo back to java?

is it possible to take an existing java object, and
turn it into SDO (dataobject), maybe serialize it,
persist it, whatever, then convert it back to it's
original java object?

if so, could someone point me to an example or
something ?

thanks in advance.



Re: java to sdo back to java?

Posted by Frank Budinsky <fr...@ca.ibm.com>.
Jean-Sebastien Delfino <js...@apache.org> wrote on 04/24/2006 11:13:38 
AM:

> For our May release we would like to demonstrate this path in the 
> BigBank scenario (we'll model the Account data with Java interfaces then 

> generate SDOs from these interfaces). Can we move the Java2SDO generator 

> currently in the sandbox to the main code stream?
> 
I restructured the original (XSD) JavaGenerator and added a new subclass 
Interface2JavaGenerator, a slightly restructured version of the Java2SDO 
generator from your sandbox.

I don't understand enough about Mojo classes, so I didn't add it. Can you 
help with that?

Frank.


Re: java to sdo back to java?

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Frank Budinsky wrote:
> For #1, Sebastien has this in the sandbox (not in the main build):  
>
> http://svn.apache.org/repos/asf/incubator/tuscany/sandbox/sebastien/java/sdo/plugin-java2sdo
>
> If you look at it, you'll see it's a simple prototype that given a Java 
> interface, will introspect it to build the SDO metadata (actually it's 
> currently doing this using EMF instead of SDO calls) and then invokes the 
> SDO codegenerator to generate static implementation classes. The part 
> that's interesting for what we're talking about is just the 
> introspection/build SDO metatdata part - so that part should be factored 
> out into a reusable component of it's own. Also it could be rewritten to 
> use SDO metadata creation APIs (instead of EMF) since we've just recently 
> added that support (see TUSCANY-39). 
>
> Given this support, we could introspect an interface or an actual POJO 
> implementation class and determine the SDO metadata. Once we have that we 
> should then be able to generate a loader as described in #2, below. 
> There's no code started for this yet, but it is high on the wish list of 
> things to get to soon.
>
> Frank.
>
>
> Paul Tomsic <pt...@yahoo.com> wrote on 04/21/2006 09:24:44 AM:
>
>   
>> the items you mention, are they available in the
>> repository?
>>
>>
>> --- Frank Budinsky <fr...@ca.ibm.com> wrote:
>>
>>     
>>> Paul,
>>>
>>> Support for what you want is possible but not
>>> implemented yet. We do want 
>>> it ... want to help? :-)
>>>
>>> Two pieces of work that are needed are:
>>>
>>> 1) the part that introspects the POJO to build the
>>> SDO metatdata. 
>>> Jean-Sebastien Delfino has the start of a prototype
>>> for that.
>>> 2) the ability to generate a StAX loader/serializer
>>> for the POJO. The 
>>> hand-coded loader that is used for the SCA assembly
>>> model is the prototype 
>>> that we plan to use to design the generator
>>> patterns.
>>>
>>> With these two pieces, added to what's already
>>> there, I think you'd have 
>>> everything you need to do what you're asking.
>>>
>>> Frank.
>>>
>>>
>>> Paul Tomsic <pt...@yahoo.com> wrote on 04/21/2006
>>> 08:23:53 AM:
>>>
>>>       
>>>>> 1) What's your java object? Is it a JavaBean (or
>>>>> even further, generated 
>>>>> from XSD)?
>>>>>           
>>>> serializable pojos, mostly.  there's no XSD,
>>>>         
>>> however,
>>>       
>>>> that represents the object.  so i'm basically
>>>>         
>>> looking
>>>       
>>>> for a "Bean -> XSD -> DataGraph/DataObject ->
>>>> Serialize/Wire -> Bean"
>>>>
>>>> kinda like JAXB/Jibx/Something kinda marhsalling
>>>>         
>>> here.
>>>       
>>>> the problem is, since i don't have the XSDs, then
>>>>         
>>> if
>>>       
>>>> the pojo changes and version rev's, then i'll also
>>>> have to update the xsd to stay in sync.
>>>>
>>>>
>>>>
>>>>         
>>>>> 3) If your java objects are also created from
>>>>>           
>>> XSDs,
>>>       
>>>>> then it's easy to 
>>>>> tranform the java object to SDO and vice versa
>>>>>           
>>> using
>>>       
>>>>> XML as the intermediate 
>>>>> format.
>>>>>           
>>>> see above.  thanks
>>>>
>>>>         
>>>>> Thanks,
>>>>> Raymond
>>>>>
>>>>> ----- Original Message ----- 
>>>>> From: "Paul Tomsic" <pt...@yahoo.com>
>>>>> To: <tu...@ws.apache.org>
>>>>> Sent: Thursday, April 20, 2006 5:37 PM
>>>>> Subject: java to sdo back to java?
>>>>>
>>>>>
>>>>>           
>>>>>> is it possible to take an existing java
>>>>>>             
>>> object,
>>>       
>>>>> and
>>>>>           
>>>>>> turn it into SDO (dataobject), maybe serialize
>>>>>>             
>>> it,
>>>       
>>>>>> persist it, whatever, then convert it back to
>>>>>>             
>>> it's
>>>       
>>>>>> original java object?
>>>>>>
>>>>>> if so, could someone point me to an example or
>>>>>> something ?
>>>>>>
>>>>>> thanks in advance.
>>>>>>
>>>>>>
>>>>>>             
>>>>>           
>>>       
>
>
>   
For our May release we would like to demonstrate this path in the 
BigBank scenario (we'll model the Account data with Java interfaces then 
generate SDOs from these interfaces). Can we move the Java2SDO generator 
currently in the sandbox to the main code stream?

-- 
Jean-Sebastien


Re: java to sdo back to java?

Posted by Frank Budinsky <fr...@ca.ibm.com>.
For #1, Sebastien has this in the sandbox (not in the main build):  

http://svn.apache.org/repos/asf/incubator/tuscany/sandbox/sebastien/java/sdo/plugin-java2sdo

If you look at it, you'll see it's a simple prototype that given a Java 
interface, will introspect it to build the SDO metadata (actually it's 
currently doing this using EMF instead of SDO calls) and then invokes the 
SDO codegenerator to generate static implementation classes. The part 
that's interesting for what we're talking about is just the 
introspection/build SDO metatdata part - so that part should be factored 
out into a reusable component of it's own. Also it could be rewritten to 
use SDO metadata creation APIs (instead of EMF) since we've just recently 
added that support (see TUSCANY-39). 

Given this support, we could introspect an interface or an actual POJO 
implementation class and determine the SDO metadata. Once we have that we 
should then be able to generate a loader as described in #2, below. 
There's no code started for this yet, but it is high on the wish list of 
things to get to soon.

Frank.


Paul Tomsic <pt...@yahoo.com> wrote on 04/21/2006 09:24:44 AM:

> the items you mention, are they available in the
> repository?
> 
> 
> --- Frank Budinsky <fr...@ca.ibm.com> wrote:
> 
> > Paul,
> > 
> > Support for what you want is possible but not
> > implemented yet. We do want 
> > it ... want to help? :-)
> > 
> > Two pieces of work that are needed are:
> > 
> > 1) the part that introspects the POJO to build the
> > SDO metatdata. 
> > Jean-Sebastien Delfino has the start of a prototype
> > for that.
> > 2) the ability to generate a StAX loader/serializer
> > for the POJO. The 
> > hand-coded loader that is used for the SCA assembly
> > model is the prototype 
> > that we plan to use to design the generator
> > patterns.
> > 
> > With these two pieces, added to what's already
> > there, I think you'd have 
> > everything you need to do what you're asking.
> > 
> > Frank.
> > 
> > 
> > Paul Tomsic <pt...@yahoo.com> wrote on 04/21/2006
> > 08:23:53 AM:
> > 
> > > 
> > > > 
> > > > 1) What's your java object? Is it a JavaBean (or
> > > > even further, generated 
> > > > from XSD)?
> > > 
> > > serializable pojos, mostly.  there's no XSD,
> > however,
> > > that represents the object.  so i'm basically
> > looking
> > > for a "Bean -> XSD -> DataGraph/DataObject ->
> > > Serialize/Wire -> Bean"
> > > 
> > > kinda like JAXB/Jibx/Something kinda marhsalling
> > here.
> > > 
> > > the problem is, since i don't have the XSDs, then
> > if
> > > the pojo changes and version rev's, then i'll also
> > > have to update the xsd to stay in sync.
> > > 
> > > 
> > > 
> > > > 3) If your java objects are also created from
> > XSDs,
> > > > then it's easy to 
> > > > tranform the java object to SDO and vice versa
> > using
> > > > XML as the intermediate 
> > > > format.
> > > 
> > > see above.  thanks
> > > 
> > > > 
> > > > Thanks,
> > > > Raymond
> > > > 
> > > > ----- Original Message ----- 
> > > > From: "Paul Tomsic" <pt...@yahoo.com>
> > > > To: <tu...@ws.apache.org>
> > > > Sent: Thursday, April 20, 2006 5:37 PM
> > > > Subject: java to sdo back to java?
> > > > 
> > > > 
> > > > > is it possible to take an existing java
> > object,
> > > > and
> > > > > turn it into SDO (dataobject), maybe serialize
> > it,
> > > > > persist it, whatever, then convert it back to
> > it's
> > > > > original java object?
> > > > >
> > > > > if so, could someone point me to an example or
> > > > > something ?
> > > > >
> > > > > thanks in advance.
> > > > >
> > > > > 
> > > > 
> > > > 
> > > 
> > 
> > 
> 


Re: java to sdo back to java?

Posted by Paul Tomsic <pt...@yahoo.com>.
the items you mention, are they available in the
repository?


--- Frank Budinsky <fr...@ca.ibm.com> wrote:

> Paul,
> 
> Support for what you want is possible but not
> implemented yet. We do want 
> it ... want to help? :-)
> 
> Two pieces of work that are needed are:
> 
> 1) the part that introspects the POJO to build the
> SDO metatdata. 
> Jean-Sebastien Delfino has the start of a prototype
> for that.
> 2) the ability to generate a StAX loader/serializer
> for the POJO. The 
> hand-coded loader that is used for the SCA assembly
> model is the prototype 
> that we plan to use to design the generator
> patterns.
> 
> With these two pieces, added to what's already
> there, I think you'd have 
> everything you need to do what you're asking.
> 
> Frank.
> 
> 
> Paul Tomsic <pt...@yahoo.com> wrote on 04/21/2006
> 08:23:53 AM:
> 
> > 
> > > 
> > > 1) What's your java object? Is it a JavaBean (or
> > > even further, generated 
> > > from XSD)?
> > 
> > serializable pojos, mostly.  there's no XSD,
> however,
> > that represents the object.  so i'm basically
> looking
> > for a "Bean -> XSD -> DataGraph/DataObject ->
> > Serialize/Wire -> Bean"
> > 
> > kinda like JAXB/Jibx/Something kinda marhsalling
> here.
> > 
> > the problem is, since i don't have the XSDs, then
> if
> > the pojo changes and version rev's, then i'll also
> > have to update the xsd to stay in sync.
> > 
> > 
> > 
> > > 3) If your java objects are also created from
> XSDs,
> > > then it's easy to 
> > > tranform the java object to SDO and vice versa
> using
> > > XML as the intermediate 
> > > format.
> > 
> > see above.  thanks
> > 
> > > 
> > > Thanks,
> > > Raymond
> > > 
> > > ----- Original Message ----- 
> > > From: "Paul Tomsic" <pt...@yahoo.com>
> > > To: <tu...@ws.apache.org>
> > > Sent: Thursday, April 20, 2006 5:37 PM
> > > Subject: java to sdo back to java?
> > > 
> > > 
> > > > is it possible to take an existing java
> object,
> > > and
> > > > turn it into SDO (dataobject), maybe serialize
> it,
> > > > persist it, whatever, then convert it back to
> it's
> > > > original java object?
> > > >
> > > > if so, could someone point me to an example or
> > > > something ?
> > > >
> > > > thanks in advance.
> > > >
> > > > 
> > > 
> > > 
> > 
> 
> 


Re: java to sdo back to java?

Posted by Frank Budinsky <fr...@ca.ibm.com>.
Paul,

Support for what you want is possible but not implemented yet. We do want 
it ... want to help? :-)

Two pieces of work that are needed are:

1) the part that introspects the POJO to build the SDO metatdata. 
Jean-Sebastien Delfino has the start of a prototype for that.
2) the ability to generate a StAX loader/serializer for the POJO. The 
hand-coded loader that is used for the SCA assembly model is the prototype 
that we plan to use to design the generator patterns.

With these two pieces, added to what's already there, I think you'd have 
everything you need to do what you're asking.

Frank.


Paul Tomsic <pt...@yahoo.com> wrote on 04/21/2006 08:23:53 AM:

> 
> > 
> > 1) What's your java object? Is it a JavaBean (or
> > even further, generated 
> > from XSD)?
> 
> serializable pojos, mostly.  there's no XSD, however,
> that represents the object.  so i'm basically looking
> for a "Bean -> XSD -> DataGraph/DataObject ->
> Serialize/Wire -> Bean"
> 
> kinda like JAXB/Jibx/Something kinda marhsalling here.
> 
> the problem is, since i don't have the XSDs, then if
> the pojo changes and version rev's, then i'll also
> have to update the xsd to stay in sync.
> 
> 
> 
> > 3) If your java objects are also created from XSDs,
> > then it's easy to 
> > tranform the java object to SDO and vice versa using
> > XML as the intermediate 
> > format.
> 
> see above.  thanks
> 
> > 
> > Thanks,
> > Raymond
> > 
> > ----- Original Message ----- 
> > From: "Paul Tomsic" <pt...@yahoo.com>
> > To: <tu...@ws.apache.org>
> > Sent: Thursday, April 20, 2006 5:37 PM
> > Subject: java to sdo back to java?
> > 
> > 
> > > is it possible to take an existing java object,
> > and
> > > turn it into SDO (dataobject), maybe serialize it,
> > > persist it, whatever, then convert it back to it's
> > > original java object?
> > >
> > > if so, could someone point me to an example or
> > > something ?
> > >
> > > thanks in advance.
> > >
> > > 
> > 
> > 
> 


Re: java to sdo back to java?

Posted by Paul Tomsic <pt...@yahoo.com>.
> 
> 1) What's your java object? Is it a JavaBean (or
> even further, generated 
> from XSD)?

serializable pojos, mostly.  there's no XSD, however,
that represents the object.  so i'm basically looking
for a "Bean -> XSD -> DataGraph/DataObject ->
Serialize/Wire -> Bean"

kinda like JAXB/Jibx/Something kinda marhsalling here.

the problem is, since i don't have the XSDs, then if
the pojo changes and version rev's, then i'll also
have to update the xsd to stay in sync.



> 3) If your java objects are also created from XSDs,
> then it's easy to 
> tranform the java object to SDO and vice versa using
> XML as the intermediate 
> format.

see above.  thanks

> 
> Thanks,
> Raymond
> 
> ----- Original Message ----- 
> From: "Paul Tomsic" <pt...@yahoo.com>
> To: <tu...@ws.apache.org>
> Sent: Thursday, April 20, 2006 5:37 PM
> Subject: java to sdo back to java?
> 
> 
> > is it possible to take an existing java object,
> and
> > turn it into SDO (dataobject), maybe serialize it,
> > persist it, whatever, then convert it back to it's
> > original java object?
> >
> > if so, could someone point me to an example or
> > something ?
> >
> > thanks in advance.
> >
> > 
> 
> 


Re: java to sdo back to java?

Posted by Raymond Feng <en...@gmail.com>.
Hi,

This is an interesting question.

1) What's your java object? Is it a JavaBean (or even further, generated 
from XSD)?
2) I think there were discussions on this mailing list to generate SDO from 
JavaBeans (approaches like wrapping, proxy or dynamic code generation).
3) If your java objects are also created from XSDs, then it's easy to 
tranform the java object to SDO and vice versa using XML as the intermediate 
format.

Thanks,
Raymond

----- Original Message ----- 
From: "Paul Tomsic" <pt...@yahoo.com>
To: <tu...@ws.apache.org>
Sent: Thursday, April 20, 2006 5:37 PM
Subject: java to sdo back to java?


> is it possible to take an existing java object, and
> turn it into SDO (dataobject), maybe serialize it,
> persist it, whatever, then convert it back to it's
> original java object?
>
> if so, could someone point me to an example or
> something ?
>
> thanks in advance.
>
>