Help -- what is allInstances when used in M2?

Date view Thread view Subject view Author view Attachment view

From: Gerrit (
Date: Fri 24 Jan 2003 - 12:23:44 GMT


I am having severe problems in stating a simple
stereotype constraint that is to extend the M2 element
I want to state the well-formedness rule that 
the stereotype BIN-CP always contains the class
instances connected to the AssociationEnds.

The scope of constraints formulated in the context of
a stereotype is the UML 
metamodel [UML-1.4, sec.] , not the model in
which a stereotype is applied. 

A tuple set is to contain the instances of classes of
the model in which the 
stereotype is to be applied. This is however on the
M1/M0 level, while the 
former is the M2 level. From the UML standard, it is
unclear how to bridge these levels.

One may assume that links are accessible in M2, as one
inclined to believe from  figure 2-17 on page 2-98 of

Thus, is the interpretation of allInstances in context
of AssociationClass at the M2 level 
 (a) the set of all named M1 model elements
     that are of type AssociationClass or 
 (b) the set of all LinkObjects by virtue of 
     the fact that a LinkObject is 
     an instance of an association class? 
The second option follows this reasoning:  in the UML
standard, a Link is an
instance of an  Association  [UML-1.4, sec.]
and an Object is an
instance originating from a  Class [UML-1.4, sec.]. 
Thus, it is concluded that an instance of an 
AssociationClass is a LinkObject 
[in the entire UML standard, I could not find any 
explicit confirmation of this].

If option (b) holds, a well-formedness constraint
could bridge this gap, such as

context BIN-CP 
  --specify how the tuples are to be formed 
   inv: mytuple = self.allInstances->collect(cp:
     Tuple{ cp.connection->reject(a|
a.isNavigable).instance } )

Is this valid and if not why does UML/OCL allow such
headaches? Any hints, suggestions,
pointers that could help shed light are greatly


Gerrit Renker                          Research
Constraints Group                      Computing
Technologies Centre
The Robert Gordon University           Aberdeen AB25

Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts

Date view Thread view Subject view Author view Attachment view