Re: AW: A question about association specialization! (slight correction)

Re: AW: A question about association specialization! (slight correction)

From: Milan Milanovic <>
Date: Mon, 4 Jun 2007 16:51:23 -0500 (CDT)
Message-ID: <>
Dear Mr. Earl,

yes, it is very helpful. Thank you very much on this explanation.

Best regards, Milan Milanovic
M.Sc. candidate
GOOD OLD AI Laboratory
Department of Information Systems and Technologies
Faculty of Organizational Sciences
University of Belgrade

----- Original Message ----
From: "Waldin, Earl" <>
Sent: Friday, June 1, 2007 8:47:02 PM
Subject: AW: A question about association specialization! (slight correction)

I need to make a slight correction. The example for the semantics of subsetting should have been:
    b.propA -> includesAll(b.propB)
and NOT
    a.propA -> includesAll(b.propB)
This would only be correct if a = b.
Sorry for any confusion.
-----Ursprüngliche Nachricht-----
Von: []Im Auftrag von Waldin, Earl
Gesendet: Friday, June 01, 2007 19:12
Betreff: RE: A question about association specialization!

Here is a brief, and certainly not complete, stab at it. UML metaclass names are initial capped.
First of all, an association in the context you are talking about here is really a Property. A Property can play the role of either an attribute or an association end. So, in the discussion below I will talk about properties, and everything I say applies to both attributes and association ends. One small note, those familiar with UML 2.x know that a Property can be owned by either a Class or an Association. A Property's owner in this case doesn't really make a difference, so don't worry about it. Think "attribute or association end" and you'll be alright.
Here are two facts:
A Feature is a RedefineableElement. This means that any feature, such as a Property, Operation, or Reception (among others) can be redefined. 
Only a Property can be subsetted.
This means that only properties can be subsetted and/or redefined. So the first difference between subsets and redefines is that more kinds of things can be redefined than subsetted.
Subsetting is more or less what you think it is. If propery b subsets property a, then the set of items referred to by b is a subset of those referred to by a. For example, if class A has a property propA, class B a property propB, B inherits from A, propB subsets propA, variable a is bound to an instance of class A and variable b to an instance of class B then, in OCL, 
   a.propA -> includesAll(b.propB).      (I hope I didn't get it backwards! But you get the idea).
Here are some other points about subsetting:
A subsetting property may not have the same name as the subsetted property. 
Both the subsetting and subsetted property are visible in the context of the subsetting class. E.g., given the example above, both b.propB and b.propA are valid expressions. 
The subsetting and subsetted properties may be owned by the same class.
In contrast, a redefinition gives a new name for an inherited feature within the namespace of the class that redefines that feature. Take the example above except that propB now renames propA. Here is the contrast:
A redefining element may have any name, including the same name as the redefined property. 
A redefined property is no longer "visible" in the redefining class.  For example, b.propB is a valid expression whereas b.propA is not. You should be able to get to propA by upcasting b, e.g., b.oclAsType(A).propA. 
You can only redefine a property defined in an ancestor. (i.e., you cannot redefine a property owned by the same class).
Semantically speaking, redefinition is more like equality. Assuming you can upcast,
     b.propB = b.oclAsType(A).propA.
Note that with both subsetting and redefinition, the subsetting/redefining property can have a different type as long as that type conforms to that of the subsetted/redefined property. This allows one to narrow the type of a property in a subclass. An example would be property superType of Class which redefines property general of Classifier. Subsetting is often used in combination with an association end that is a derived union. In this case the subsetted association is like an abstract association and the subsetting association is a specialization.
Hope this helps
    -Earl Waldin
Earl Waldin                             tel: +41 31 828 9222
Paranor AG                              fax: +41 31 828 9299
Juraweg 14                              email: earl.waldin at
CH-3046 Wahlendorf

-----Original Message-----
From: [] On Behalf Of Milan Milanovic
Sent: Thursday, 31 May, 2007 12:48
Subject: A question about association specialization!

Hi all,
can anyone give a little better explanation of the association specialization than
it is given in UML Superstructure document? I see that there are two types of 
this specialization: subsets and redefines, but I'm not sure of its meaning and their
connection to the classes inheritance which they connects.

Best regards, Milan Milanovic
M.Sc. candidate 
GOOD OLD AI Laboratory
Faculty of Organizational Sciences
Department of Information Systems and Technologies
University of Belgrade

Park yourself in front of a world of choices in alternative vehicles.
Visit the Yahoo! Auto Green Center.

Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
Received on Mon 04 Jun 2007 - 22:52:00 BST