question about DynamicData defined in xtype spec 1.0(ptc/2012-03-26)

4 posts / 0 new
Last post
Offline
Last seen: 11 years 10 months ago
Joined: 09/11/2012
Posts: 2
question about DynamicData defined in xtype spec 1.0(ptc/2012-03-26)

Hi,

In the xtype spec 1.0, section 7.5.2.11.2 , DynamicData has a property "descriptor",and some description on it: 

"This property shall contain a descriptor for each value in this object, identified by the member ID
The meaning of the member ID shall be as it is described for the value property. "


that make me confused, we know a DynamicData object contains a reference to DynamicType, and DynamicType has the MemberDescriptor for each member, why here to use MemberDescriptor again? Is it duplicate? 

I guess maybe it aims to provide some flexiblities, so can it be omitted while set value to a member of a  particular DynamicData object? Is it necessary to set the corresponding MemberDescriptor while set value to a member of a particular DynamicData object? 

Also, when and how to use descriptor property that is contained by particular DynamicData object other than DynamicType that the object references? 

How does DynamicData::get_descriptor(MemberId id) behave if MemberDesciptor for the "MemberId id" is absent in a particular DynamicData object?

 Thanks for your reply.

 

Regards,

wang xy

 

Keywords:
Gerardo Pardo's picture
Offline
Last seen: 3 weeks 5 hours ago
Joined: 06/02/2010
Posts: 602

Hi,

I agree this model is a little confusing. Probably it was not necessary to model it asa property. We could have just left the operation DynamicData::get_descriptor(MemberId id) as a convenience. In reality it is the get_descriptor  operation  the one that implements the relationship expressed by the "descriptor" link and we should not have said this was a "property"...

The  DynamicData::get_descriptor(MemberId id)  provides a different ways to navigate to the same MemberDescriptor. That you does get to by first getting the DynamicType and from there the MemberDescriptor for that memberId. They are all references so there is no copies. It just makes it easier to access to access the member-type information when you are starting from the DynamicData.

No you do not need to set these as part of setting the member value in a DynamicData. 

You should never be in that situation. The implementation of DynamicData::get_descriptor(MemberId id) will always use the DynamicType associated with that DynamicData so as long as the DynamicData has an associated type and that member ID is in the type the call  will not  should not fail.

As to when to "use descriptor property that is contained by particular DynamicData object other than DynamicType" it does not matter which one you use. They both should reference the exact same object.

Gerardo

Offline
Last seen: 11 years 10 months ago
Joined: 09/11/2012
Posts: 2

Hi Gerardo,

Thanks for your  patient explanation.

Now,  I am more clear on that.

However, I noticed that the DynamicData local interface described in Annex C(IDL presentation) of that spec has an operation set_descriptor() .

As DynamicType is immutable, I think this operation set_descriptor() is  meaningless, even an error. I guess it may be a legacy from previous version.

Am I right?

 

Regards,

xy

 

 

 

Gerardo Pardo's picture
Offline
Last seen: 3 weeks 5 hours ago
Joined: 06/02/2010
Posts: 602

Yes I think so. I could be wrong but it indeed looks like an error in the specification.  I would not have expected you would have an operation in a DynamicData that modified the data-type.  I will make sure we file and issue with the proper OMG Revision Task Force and address it on the next revision. Thank you for pointing this out.

Gerardo