Actually we are wrong here. To replace the isMany() logic you need to


dob = sequence->getDataObject*Value*(i);


getDataObject returns the sequenced DO not the value at position *i*.

Cheers,


On 15/12/06, Yang ZHONG <[EMAIL PROTECTED]> wrote:

It depends on implementation, e.g. Tuscany C++ get(property) delegates to
get(int), and Tuscany Java get(int) delegates to get(property)

On 12/14/06, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
>
> [snip]
> Pete Robbins wrote:
> > On 14/12/06, Yang ZHONG <[EMAIL PROTECTED]> wrote:
> >>
> >>                            if (seqProperty.isMany())
> >>                            {
> >>                                int index = sequence->getListIndex(i);
> >>                                dob =
> >> dataObject->getList(seqProperty)[index];
> >>                            }
> >>                            else
> >>                            {
> >>                                dob =
> >> dataObject->getDataObject(seqProperty);
> >>                            }
> >> might have an alternative:
> >>                            dob = sequence->getDataObject(i)
> >
> >
> > Correct. I recall making the same simplification in some code
> recently...
> > can't remember where though ;-) The code in CopyHelper and
> > SDOXMLWriter use
> > the longer method but I'm sure dob = sequence->getDataObject(i) will
> > work.
> >
> > Cheers,
> >
>
> OK, Thanks! I had just blindly mirrored  what I had seen in CopyHelper
> for this :) This triggers another question: Is it more efficient to
> access properties by index or by property object? In other words, should
> I do dob->getXyz(i) or dob->getXyz(property)?
>
> --
> Jean-Sebastien
>
> --
>
> Yang ZHONG




--
Pete

Reply via email to