RE: A question on UML Profile and stereotype



RE: A question on UML Profile and stereotype

From: Waldin, Earl <Earl.Waldin_at_paranor.ch>
Date: Thu, 18 Dec 2008 11:26:20 +0100
Message-ID: <1DE41A26EA92CA4FB831A9449AB0841E5DCB82@srv-par2.paranor.ch>
Arnon
 
With respect to UML, technically speaking, a stereotype definition is at
level M2. A stereotype is a metaclass that conceptually subclasses UML
metaclasses. I say conceptually because the official relationship is
extends, not subclasses, although it looks similar. From the UML 2.1.1
spec (section 18.3):

A stereotype defines how an existing metaclass may be extended, and
enables the use of platform or domain specific
terminology or notation in place of, or in addition to, the ones used
for the extended metaclass.

A stereotype is a limited kind of metaclass that cannot be used by
itself, but must always be used in conjunction with one of the
metaclasses it extends. 

A Profile is also at level M2, at least from the standpoint of its
definition. Again from the spec (section 18.3.6)

A profile is a restricted form of a metamodel that must always be
related to a reference metamodel, such as UML, ...

A Profile is applied to a model at level M1. (section 18.3.7 Profile
Application)

One or more profiles may be applied at will to a package that is created
from the same metamodel that is extended by the profile. Applying a
profile means that it is allowed, but not necessarily required, to apply
the stereotypes that are defined as part of the profile.

When you apply a stereotype to an M1 class, you create an instance of
that stereotype. So, a stereotype definition is M2 while an application
of that stereotype is M1. This is not easy to grasp because the UML
metamodel is M2 and it defines stereotypes.  Usually, an instance of an
M2 thing is an M1 thing, e.g., an instance of the M2 UML metaclass Class
is an M1 Class. However, a stereotype, which is an instance of the M2
UML metaclass Stereotype, is itself M2 and not M1. This is the
meta-circular conceptual price you pay when you want something like UML
to define a way to extend itself using its own language.
 
Hope this helps.
 
    -Earl 

----------------------------------------------------------------------
Earl Waldin                             tel: +41 31 828 9222
Paranor AG                              fax: +41 31 828 9299
Juraweg 14                              email: earl.waldin@paranor.ch
CH-3046 Wahlendorf
Switzerland
----------------------------------------------------------------------


 
  -----Original Message-----
From: puml-list-request@cs.york.ac.uk
[mailto:puml-list-request@cs.york.ac.uk] On Behalf Of Arnon Sturm
Sent: Thursday, 18 December, 2008 09:52
To: puml-list@cs.york.ac.uk
Subject: A question on UML Profile and stereotype



All,
 
I wonder in what level of the MOF architecture (i.e.,M1 or M2) profile
and stereotype are defined and in what level these are applied.
 
I'll appreciate getting any references on that issue.
 
Thanks for your help,
 
Arnon
Received on Thu 18 Dec 2008 - 10:26:21 GMT