Re: Wiring components in the UML 2 metamodel



Re: Wiring components in the UML 2 metamodel

From: Vladimir Mencl ^lt;mencl@nenya.ms.mff.cuni.cz>
Date: Thu 29 Sep 2005 - 04:50:24 BST
Message-ID: <433B6480.1060403@nenya.ms.mff.cuni.cz>
On 09/28/2005 10:29 PM, Miguel Goul„o wrote:
> Hello,
> 
> In the UML 2.0 metamodel, a component may have provided and required
> interfaces. But I am having problems with linking a provided to a required
> interface. It looks simple in a component diagram, but which are the
> metaclasses involved?
> 
> To make my problem clear, suppose component A provides interface X and
> component B requires interface X, as well. How do I represent the wiring
> of component A to component B, through interface X, in the metamodel?
> 
> I can use the metaclass Component for representing A and B, the metaclass
> Interface for representing X, but can't find a suitable way of saying that
> B is using A's provided interface X (rather than C's provided interface X,
> for instance).
> 
> The metaclass representing Connector, presented on the same specification
> chapter (and also defined in the SimpleComponents package) seems to be
> unattached from the rest of the metamodel. :-(
> 
> Is this a bug in the metamodel itself, or am I missing the correct link,
> somehow? Thanks in advance for any help/comments.

Hi Miguel,

the UML 2.0 specification is not highlighting that too much - you might 
have overlooked that Connector (in Components package) inherits from 
Connector (in InternalStructures). This is not shown in the abstract 
syntax diagram, and is only mentioned in the detailed description of the 
Connector (Compoments) metaclass (pg 150 of formal/05-07-04):

   Generalizations:
     Connector (from InternalStructures)  on page 170 (merge increment)

The Connector (InternalStructures) metaclass can associate (via a 
ConnectorEnd element) an ConnectableElement.

This should allow to link connectors to the rest of the metamodel.
As for the question of how this should be modeled:
   - The situation is clear in the case of a Port, which inherits from 
Property (InternalStructures), which can be associated from a 
ConnectorEnd as partWithPort.

   - In the case of Interfaces directly associated with a Component, the 
situation is more difficult, as there is no intermediate element 
representing the "interface occurence" of a given interface as either a 
provided or required. I.e., Component directly associates the Interface 
metaclass and same as in Miguel's example, both components A and B would 
associate the same model element X (instance of Interface metaclass), 
and it would not be possible to specify which "instances of X" a 
connector links.

   Apparently, the correct approach is to model the component as a 
Collaboration, where the interface is associated as a collaborationRole 
(typed as ConnectableElement). However, even here, the specification 
does not say which metaclass should be used to create distinct 
representations of the same interface type.

Can anybody comment on this and provide an explanation?

In UML 1.x, ClassifierRole was used to model several roles of a single 
classifier - but it has been "superseded by Collaborations".

Vladimir


--
----------------------------------
Vladimir Mencl, Ph.D.
Researcher
   |currently on academic leave at UNU/IIST,
   |see http://www.iist.unu.edu/~mencl/

Distributed Systems Research Group
Department of Software Engineering
Faculty of Mathematics and Physics
Charles University, Prague
Malostranske namesti 25
11800, Prague, Czech Republic
http://nenya.ms.mff.cuni.cz/

e-mail: vladimir.mencl@mff.cuni.cz
http://nenya.ms.mff.cuni.cz/~mencl/


> 
> Miguel Goul„o
> 
> 
> 
> 
> 
> 
> To remove yourself from this list please mail puml-list-request@cs.york.ac.uk
> with a message containing the word "unsubscribe".
Received on Thu Sep 29 04:50:42 2005