UML Profiles



Date view Thread view Subject view Author view Attachment view

From: Frédéric FONDEMENT (frederic.fondement@epfl.ch)
Date: Sat 13 Mar 2004 - 23:12:17 GMT


Dear all,
 
I have a problem with UML profiles. In UML 2.0, it is said that:
"As part of a profile, it is not possible to have an association between two stereotypes or between a stereotype and a metaclass unless they are subsets of existing associations in the reference metamodel."
Can somebody tell why of this constraint? And how is the existing association provided in the profile (notation and abstract syntax)? Can this existing association be a "virtual" one if defined as an OCL query?
 
"However, it is possible to have associations between ordinary classes, and from stereotypes to ordinary classes. Likewise, properties of stereotypes may not be typed by metaclasses or stereotypes."
Here I have a serious problem on notation to be adopted in the model the profile is applied. There is an example of such a usage in figure 115, showing a class (JavaInteger) used both by the profile and the model what is applied the profile (see attachment). This JavaInteger  seriously looks like a data type, so that it is possible to reference an instance in the profile application with a literal value (volume=10). My problem is what to do with instances of classes that do not look like data types? As an example, let's imagine a Remote class in the profile associated to the device stereotype. How to create a remote in the model and how to represent it as a tagged value for the TV?
 
Actually, my first feeling was exactly the contrary of what UML says: stereotype properties may only be associated to metaclasses or other stereotypes, because I can't see a solution for the above problem. For instance, if needed a Remote to be associated to a Device, let's define the stereotype Remote on the metaclass Class, so that it is possible in the model to create a class InfraredGenericRemote what is applied this Remote stereotype. To represent the association, then place a note indicating the stereotype, as UML already says, and then place in it device= Set{InfraredGenericRemote} in the Device tagged values definition and remote=Set{TV} in the Remote tagged values definition (provided the association has a * <-> * multiplicity).

Cheers,

Frédéric Fondement



Date view Thread view Subject view Author view Attachment view