Objects collection |
Post Reply |
Author | |
Saivignesh
Contributor Joined: 01.May.2017 Location: Netherlands Points: 17 |
Post Options
Thanks(0)
Posted: 10.May.2017 at 14:38 |
I have object A and object B. Is it possible to have a property of an Object C which is a collection of Object A and Object B?
|
|
jpt
MetaCase Joined: 25.Mar.2008 Points: 239 |
Answer Post Options Thanks(0) |
Yes, if they are in the same type hierarchy. You could also have one abstract type '_Object' as supertype for Object A and Object B and then use that abstract type in the collection.
In some exceptional circumstances it may be desirable to specify the supertype of all the types of that metatype, e.g. Object: you can do this by selecting the metatype from the pull-down list with shift held down, and that metatype will then be included in the list of types to select from. For details see Collection properties. For an example, see in demo repository 'EAST-ADL' project and there definition of 'FeatureFlaw' object type. It has a collection property 'nonFullFilledRequirements' that refers to hierarchy (of requirements). |
|
Saivignesh
Contributor Joined: 01.May.2017 Location: Netherlands Points: 17 |
Post Options
Thanks(0)
|
Object A and Object B are separate objects. Is it possible then?
|
|
jpt
MetaCase Joined: 25.Mar.2008 Points: 239 |
Post Options
Thanks(0)
|
Yes, if they are in the same type hierarchy, e.g. Object A is supertype of B, or they have common supertype. Supertype would be then the item of the collection. For subtyping please see also discussion on subtyping after creation of Object Type.
|
|
Post Reply | |
Tweet |
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |