You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Pete Robbins <ro...@googlemail.com> on 2006/12/06 23:16:11 UTC

[C++] SDO: mixing DataObjects from different DataFactory instances

There is a restriction in the current implementation that forces all
DataObjects in a graph to belong to the same DataFactory. I'm not convinced
we need this. Currently if you create a DataObject (do1) from a DataFactory
(df1) and then set that as a property on DataObject (do2) that was created
from DataFactory (df2) the code:

   1. Iterates over all the types and properties of do1 recursively
   checking that the types are defined in df2
   2. Iterates through all the instance properties of do1 (recursively
   for props that are DOs) changing the DataFacory of each to df2
   3. burns the cpu out while doing this
   4. crashes as there are many bugs in this logic

While looking into a fix for this I think the easiest solution is to just
not have the restriction at all. The only check that is necessary is that
the Type of do1 matches the Type of the property being set on do2. do1 still
remembers that its DataFactory is df1.This "appears" to work but I'm sure
some corner cases may turn up that require fixing.

Am I missing something obvious here?

Cheers,

-- 
Pete

Re: [C++] SDO: mixing DataObjects from different DataFactory instances

Posted by Yang ZHONG <le...@gmail.com>.
I agree we don't need the same-DataFactory restriction.

There might be historical reason(s) for such implementation.
Without knowing the details, I don't see the restriction make sense from
modeling perspective.

A Type's Property's Type may come from a different DataFactory/scope,
and it may also be extended/inherited/XsiTyped by Types from a different
DataFactory/scope.

More importantly, for a Type having "any" element or anyAttribute, why do we
want to restrict values from any other DataFactory/scope?


On 12/6/06, Pete Robbins <ro...@googlemail.com> wrote:
>
> There is a restriction in the current implementation that forces all
> DataObjects in a graph to belong to the same DataFactory. I'm not
> convinced
> we need this. Currently if you create a DataObject (do1) from a
> DataFactory
> (df1) and then set that as a property on DataObject (do2) that was created
> from DataFactory (df2) the code:
>
>   1. Iterates over all the types and properties of do1 recursively
>   checking that the types are defined in df2
>   2. Iterates through all the instance properties of do1 (recursively
>   for props that are DOs) changing the DataFacory of each to df2
>   3. burns the cpu out while doing this
>   4. crashes as there are many bugs in this logic
>
> While looking into a fix for this I think the easiest solution is to just
> not have the restriction at all. The only check that is necessary is that
> the Type of do1 matches the Type of the property being set on do2. do1
> still
> remembers that its DataFactory is df1.This "appears" to work but I'm sure
> some corner cases may turn up that require fixing.
>
> Am I missing something obvious here?
>
> Cheers,
>
> --
> Pete
>
>


-- 

Yang ZHONG