Stereotype instances in profile applications



Stereotype instances in profile applications

From: Rodolfo Campero ^lt;rodolfo.campero@gmail.com>
Date: Sun 18 Sep 2005 - 17:04:51 BST
Message-ID: <183cc9f10509180904268f7f8c@mail.gmail.com>
Dear group,

As this is my first message to the list, I think I should introduce
myself. My name is Rodolfo Campero, and I'm working on ExpertCoder
[1], a set of libraries for CIL implementations (.NET, Mono, dotGNU)
that includes a library to manipulate UML 2 models and XMI v2.0
serialization.

I'm trying to understand how stereotypes are modeled and interchanged
in UML 2.0.

The samples of XMI serialization given in the standard [2] (chapter
18.3.6 - Profile, under "Using XMI to exchange Profiles") show a
stereotype instance just like this:

<HomeExample:Home base_Interface="id2" magic="1234"/>

However, in the discussion about the issue 8094 [3] it's mentioned
that "an instance of a stereotype is represented an instance of
InstanceSpecification with its type set to the appropriate Stereotype"
(sic), which apparently makes sense, because that would be a
homogeneous way to handle stereotype instances.

But I was thinking over this and I realized that this approach is
broken. Let me explain: if an instance of a user defined stereotype
was modeled as an InstanceSpecification, the property used to link the
stereotype with the metaclass would have a corresponding slot;
however, there's no way to relate said slot with the model element
being extended, which is basically any instance of UML::Element. The
values of a slot must be classified by ValueSpecification, and
currently there are only four kinds of ValueSpecifications:

1. Expression
2. OpaqueExpression
3. LiteralSpecification
4. InstanceValue

1, 2 and 3 are inappropriate because they don't provide a way to link
to any element. 4 is meant to link to InstanceSpecification, and we
need to link to any element, not just InstanceSpecifications - e.g.
instances of Class.

Maybe, just as Stereotype is a specialization of Class, a new
metamodel element is needed, which could be a specialization of
ValueSpecification. This would allow to link the
"base$'extendedMetaclassName'" property of a Stereotype to the actual
extended model element in an instance of that Stereotype. But I'm
beating around the bushes.

Besides, the serialization of InstanceSpecification instances is well
defined and bears no resemblance to the example given above; thus, I
wonder: what's the standard way to model and interchange user
stereotype instances?

I can summarize my concerns with this question: given a diagram, we
can point at any drawing and name its corresponding metamodel element
(Class, Association, Link, etc). Can we still say the same about the
comment-like shapes that represent an applied stereotype (the note and
the dashed line)?

I'm sure that I'm missing something here. If you know the answer,
please do take a few seconds to put me back on track.

On a related note, if someone could provide me a XMI sample of a
_standard_ stereotype (e.g. <<auxiliary>>) applied to some arbitrary
model element, I would really appreciate it. 

Thanks in advance,

Rodolfo

[1] ExpertCoder: http://expertcoder.sf.net/en/index.html
[2] Unified Modeling Language: Superstructure - version 2.0 -
formal/05-07-04
[3] http://www.omg.org/issues/issue8094.txt
Received on Sun Sep 18 17:05:30 2005