You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Christian Landbo Frederiksen <Ch...@ementor.dk> on 2007/01/27 13:29:57 UTC

Just wondering...

I was wondering what goes on in the background, since SDO can be used
the way is is used.
 
In the example:
org.apache.tuscany.samples.sdo.specCodeSnippets.CreateDataObjectFromXsdA
ndXmlFiles
 
types are defined in one static method like this:
XSDHelper.INSTANCE.define(is, null);
 
and then in another static method xml is loaded: XMLDocument xmlDoc =
XMLHelper.INSTANCE.load(is);
 
What is the connection between these two separate method invocations?
How does the loading of xml use the types defined above? I assume
something is stored somewhere but how does this relate to garbage
collection and thread safety? I meas somebody could call
XSDHelper.INSTANCE.define(is, null); with another xsd somewhere else in
the same VM?
 
/Chr
 
 
 
 

Re: Just wondering...

Posted by kelvin goodson <ke...@gmail.com>.
Christian,

  sorry not to get to this sooner.  The methods you point out are not static
methods,  but are executed in the context of the singleton helpers,  and the
metadata generated by the XSDHelper.INSTANCE singleton is stored in the
TypeHelper.INSTANCE and accessed from there by the
XMLHelper.INSTANCEsingleton.  Together these singletons form a default
set of helpers centred
around a default scope for types.  The recently introduced HelperContext SDO
2.1 API allows you to create new collections of helpers that together define
alternative scopes.

If you are using the Tuscany SDO M2 release the HelperContext is not
available to you.  In that case you must make use of the Tuscany specific
SDOUtil methods SDOUtil.createTypeHelper()  and
SDOUtil.createXSDHelper(TypeHelper)
etc.

Regards, Kelvin.

On 27/01/07, Christian Landbo Frederiksen <
Christian.Landbo.Frederiksen@ementor.dk> wrote:
>
> I was wondering what goes on in the background, since SDO can be used
> the way is is used.
>
> In the example:
> org.apache.tuscany.samples.sdo.specCodeSnippets.CreateDataObjectFromXsdA
> ndXmlFiles
>
> types are defined in one static method like this:
> XSDHelper.INSTANCE.define(is, null);
>
> and then in another static method xml is loaded: XMLDocument xmlDoc =
> XMLHelper.INSTANCE.load(is);
>
> What is the connection between these two separate method invocations?
> How does the loading of xml use the types defined above? I assume
> something is stored somewhere but how does this relate to garbage
> collection and thread safety? I meas somebody could call
> XSDHelper.INSTANCE.define(is, null); with another xsd somewhere else in
> the same VM?
>
> /Chr
>
>
>
>
>
>