On 08/12/06, Simon Laws <[EMAIL PROTECTED]> wrote:

On 12/7/06, Pete Robbins <[EMAIL PROTECTED]> wrote:
>
> On 07/12/06, Frank Budinsky <[EMAIL PROTECTED]> wrote:
> >
> > Pete is right about how it works and that it is kind of ugly. We have
an
> > internal way of doing it more easily, but the only way an SDO client
can
> > do it is the way Pete said. Maybe we need to open an SDO 3 spec issue
> for
> > adding a convenient way to access "non-sequenced" properties of a
> > sequenced object (i.e., instanceProperties that are not also in the
> > sequence).
> >
> > Frank.
>
>
>
> That's a good idea. getNonSequencedProperties() which would return the
> same
> list of properties as getInstanceProperties() if the SDO was not
> sequenced.
> We could add something like this as a Tuscany extra until it gets spec
> approval.
>
> Actually maybe this would be a method on Sequence and would only return
> the
> list of non-sequenced Properties that had been set, similar to the way
> Sequence only contains Properties that are set.
>
> Anyho... food for thought. Fixing C++ implementation will be a good
first
> step!
>
> Cheers,
>
> "Pete Robbins" <[EMAIL PROTECTED]> wrote on 12/07/2006 11:56:12
AM:
> >
> > > On 07/12/06, Simon Laws <[EMAIL PROTECTED]> wrote:
> > > >
> > > >
> > > > >
> > > > > Thanks for that Frank. When a data object has an XSD based type
is
> > there
> > > > are way of getting all of it's properties which the XSD  says are
> > > > attributes.
> > > >
> > > > This is where it gets a bit ugly. It's ok if you know what the
> > attribute
> > > names are as you can just do a getXXX("attribute_name") but if you
are
> > > dealing with an object whose type you do not know you would have to
> > iterate
> > > through the instance properties and do a getXXX for each one that
> > > prop.isAttribute() is true.
> > >
> > > Easy... except we don't have that prop.isAttribute() method in C++.
We
> > have
> > > an internal way of determining this but that is not currently
exposed
> in
> > our
> > > API. I really do not like these methods being on XSDHelper as they
are
> > in
> > > Java. IMO it is simpler and more logical to have these as attributes
> of
> > the
> > > Property.
> > >
> > > Cheers,
> > >
> > >
> > > --
> > > Pete
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Pete
>
> In a sequenced data object is it important that we identify some data as
not sequenced? We are only having this conversation because we know that
some data is going to be written out as an attribute. Are there other
examples we can point to? Even in the XML case we are talking about about
providing a convenient way of determining if a property is an attribute
but
does this mean it has to be accessed in a different way from the rest of
the
sequence. I do realize that from an XML point of view an attribute is not
part of the sequence but from an SDO point of view do we care?

If you're answer is that we are trying to provide a flexible model that
allows part of the data object to be sequenced and part not then that is
possibly OK. If the answer is that we are trying to separate elements from
attributes then that strikes me as XML specific. The problem I have is if
we
code up the setXXX methods on a data object to add to the sequence
automatically then the decision as to whether data gets added to the
sequence or not will be hidden in the implementation and based on some
magic
flags. This may lead to future confusion.



It's not really magic flags though. You defined the property as an attribute
so you should know to access it with getXXX. It's no different than you
having to know to call getString or getDataObject depending on how the
property was defined in the schema.

If for a Sequenced DO all Property settings go into  the sequence then you
could iterate over the sequence to retrieve all properties that were set. It
makse the users code simpler but makes the serialization code harder (but
why do you care about that ;-) ) as it would have to iterate over all
Sequence entries twice, once to find any Property with "isAttribute" set and
again to get the XML sequenced data. This may be the best solution.


Cheers,

--
Pete

Reply via email to