Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Usage of DerivedUnion or simple derived?
Usage of DerivedUnion or simple derived? [message #478016] Tue, 25 November 2008 09:04 Go to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Hey UMLer,

currently, i'm defining an UML-approximated metamodel, in which i make
heavily usage of subset/union. I understand the principles, that stand
behind these concepts, but is there a simple rule of thumb, when to use
Derived Union or simple derived attribute?

Let's have a look in the UML superstructure (Fig 7.10 (Features) and 7.14
(Packages)) the association end /feature between Classifier and Feature
(7.10) is declared as a DerivedUnion, because its content are derived from
the concrete participants. So far so good.
But the association end /ownedType between Package and Type is just an
ordinary subset. Should this be rather a DerivedUnion too, because its
contents are derived from the concrete types, which participate in that
association???

So, is there a rule of thumb when to use the one and when the other concept,
particulary with regard to derived and DerivedUnion?

Thanks for any comments on this topic.
Timothy
Re: Usage of DerivedUnion or simple derived? [message #478031 is a reply to message #478016] Wed, 26 November 2008 21:29 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Timothy,


The UML specification defines derived unions in the following way: "A
property may be marked as being a derived union. This means that the
collection of values denoted by the property in some context is derived by
being the strict union of all of the values denoted, in the same context, by
properties defined to subset it. If the property has a multiplicity upper
bound of 1, then this means that the values of all the subsets must be null
or the same."
More simply put, derived unions indicate that a feature is the union of one
or more collections or scalar. Derived unions are analogous to abstract
methods in Java. As with abstract methods, derived unions really only make
sense in the context of a concrete type defining what is contributed.
Derived unions are useful if you wish to indicate that a particular
meta-type defines a feature but that feature is to be defined within the
context of other meta-types. Users of derived unions would create a
property which subsets the property marked as a derived union and then
contributes more objects to the collection. A derived union is typically
applied to properties on abstract types high up in the inheritance
hierarchy.


Classifier::features is a derived union. The collection is not directly
changeable.

In the case of Package::ownedType, it is *not* the case that ownedType only
"makes sense" in the context of other features that subset it. It derives
its values from the packaged elements that are of type uml::Type.

The article
http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Custo mizing_UML2_Which_Technique_is_Right_For_You/article.html
attempts to explain this, as does
http://www.eclipse.org/modeling/mdt/uml2/docs/tutorials/Ecli pseCon2008_Tutorial_Creating_Robust_Scalable_DSL_with_UML_fi les/frame.html

HTH
-James.



"Timothy Marc" <timothymarc@freenet.de> wrote in message
news:gggev5$180$1@build.eclipse.org...
> Hey UMLer,
>
> currently, i'm defining an UML-approximated metamodel, in which i make
> heavily usage of subset/union. I understand the principles, that stand
> behind these concepts, but is there a simple rule of thumb, when to use
> Derived Union or simple derived attribute?
>
> Let's have a look in the UML superstructure (Fig 7.10 (Features) and 7.14
> (Packages)) the association end /feature between Classifier and Feature
> (7.10) is declared as a DerivedUnion, because its content are derived from
> the concrete participants. So far so good.
> But the association end /ownedType between Package and Type is just an
> ordinary subset. Should this be rather a DerivedUnion too, because its
> contents are derived from the concrete types, which participate in that
> association???
>
> So, is there a rule of thumb when to use the one and when the other
> concept, particulary with regard to derived and DerivedUnion?
>
> Thanks for any comments on this topic.
> Timothy
>
Re: Usage of DerivedUnion or simple derived? [message #627248 is a reply to message #478016] Wed, 26 November 2008 21:29 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Timothy,


The UML specification defines derived unions in the following way: "A
property may be marked as being a derived union. This means that the
collection of values denoted by the property in some context is derived by
being the strict union of all of the values denoted, in the same context, by
properties defined to subset it. If the property has a multiplicity upper
bound of 1, then this means that the values of all the subsets must be null
or the same."
More simply put, derived unions indicate that a feature is the union of one
or more collections or scalar. Derived unions are analogous to abstract
methods in Java. As with abstract methods, derived unions really only make
sense in the context of a concrete type defining what is contributed.
Derived unions are useful if you wish to indicate that a particular
meta-type defines a feature but that feature is to be defined within the
context of other meta-types. Users of derived unions would create a
property which subsets the property marked as a derived union and then
contributes more objects to the collection. A derived union is typically
applied to properties on abstract types high up in the inheritance
hierarchy.


Classifier::features is a derived union. The collection is not directly
changeable.

In the case of Package::ownedType, it is *not* the case that ownedType only
"makes sense" in the context of other features that subset it. It derives
its values from the packaged elements that are of type uml::Type.

The article
http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Custo mizing_UML2_Which_Technique_is_Right_For_You/article.html
attempts to explain this, as does
http://www.eclipse.org/modeling/mdt/uml2/docs/tutorials/Ecli pseCon2008_Tutorial_Creating_Robust_Scalable_DSL_with_UML_fi les/frame.html

HTH
-James.



"Timothy Marc" <timothymarc@freenet.de> wrote in message
news:gggev5$180$1@build.eclipse.org...
> Hey UMLer,
>
> currently, i'm defining an UML-approximated metamodel, in which i make
> heavily usage of subset/union. I understand the principles, that stand
> behind these concepts, but is there a simple rule of thumb, when to use
> Derived Union or simple derived attribute?
>
> Let's have a look in the UML superstructure (Fig 7.10 (Features) and 7.14
> (Packages)) the association end /feature between Classifier and Feature
> (7.10) is declared as a DerivedUnion, because its content are derived from
> the concrete participants. So far so good.
> But the association end /ownedType between Package and Type is just an
> ordinary subset. Should this be rather a DerivedUnion too, because its
> contents are derived from the concrete types, which participate in that
> association???
>
> So, is there a rule of thumb when to use the one and when the other
> concept, particulary with regard to derived and DerivedUnion?
>
> Thanks for any comments on this topic.
> Timothy
>
Previous Topic:[Announce] MDT UML2 3.0.0 I200811260933 is available
Next Topic:Export to UML from ECORE fails
Goto Forum:
  


Current Time: Thu Apr 25 22:08:54 GMT 2024

Powered by FUDForum. Page generated in 0.02846 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top