You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Erich Rueede <er...@yahoo.com> on 2006/12/15 15:08:21 UTC

Instantiate static SDOs with DataFactory

Hi all,

I'm referring to Philipp Schöpfs questions about instantiating a static
SDO through the DataFactory.INSTANCE.create(Person.class) method.

This works without exception for me BUT the actual object created is not
static but dynamic (DynamicDataObjectImpl) and therefore it cannot be type-
casted to "Person". I actually expected a "PersonImpl" to be returned...

So the question is:
Is it possible to use the dynamic API to create an SDO and then subsequently
switch to a static type of processing? This actually works with the EMF-based
SDO 1.0 implementation.

Thanks,

Erich


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: Instantiate static SDOs with DataFactory

Posted by kelvin goodson <ke...@gmail.com>.
Hi Erich,
  it sounds to me like you have managed to register the types dynamically
(perhaps as well as statically);
i.e. in addition to a call to
SDOUtil.registerStaticTypes(FactoryThatCreatesPersonClassesEtc.class);
I think you must have a call to something like
XSDHelper.INSTANCE.define(input_stream_from_SchemaThatDefinesPersonTypeEtc);
somewhere,  and that would seem to be masking the static defintion on Type
lookup

In answer to your question,  if, when using the dynamic API to create a
DataObject, the Type of data object that you are creating was registered
statically, then, as you suggest ought to be the case above,  you can use
either the static or the dynamic APIs on that data object.  If however the
type was registered dynamically, then you can only use the dynamic api.

Regards, Kelvin.

On 15/12/06, Erich Rueede <er...@yahoo.com> wrote:
>
> Hi all,
>
> I'm referring to Philipp Schöpfs questions about instantiating a static
> SDO through the DataFactory.INSTANCE.create(Person.class) method.
>
> This works without exception for me BUT the actual object created is not
> static but dynamic (DynamicDataObjectImpl) and therefore it cannot be
> type-
> casted to "Person". I actually expected a "PersonImpl" to be returned...
>
> So the question is:
> Is it possible to use the dynamic API to create an SDO and then
> subsequently
> switch to a static type of processing? This actually works with the
> EMF-based
> SDO 1.0 implementation.
>
> Thanks,
>
> Erich
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>

Re: Instantiate static SDOs with DataFactory

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

It definitely should work, so I suspect that there may be something funny 
about your environment, or maybe we've broken something lately. Are you 
using the latest Tuscany code?

Frank




Erich Rueede <er...@yahoo.com> 
12/15/2006 09:08 AM
Please respond to
tuscany-user@ws.apache.org


To
tuscany-user@ws.apache.org
cc

Subject
Instantiate static SDOs with DataFactory






Hi all,

I'm referring to Philipp Schöpfs questions about instantiating a static
SDO through the DataFactory.INSTANCE.create(Person.class) method.

This works without exception for me BUT the actual object created is not
static but dynamic (DynamicDataObjectImpl) and therefore it cannot be 
type-
casted to "Person". I actually expected a "PersonImpl" to be returned...

So the question is:
Is it possible to use the dynamic API to create an SDO and then 
subsequently
switch to a static type of processing? This actually works with the 
EMF-based
SDO 1.0 implementation.

Thanks,

Erich


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org