Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

Re: RE : question UML

New Message Reply Date view Thread view Subject view Author view

Subject: Re: RE : question UML
From: Pierre (bommel@cirad.fr)
Date: Thu Sep 28 2006 - 15:59:55 CEST

Ola Olivier,

I respond in english because your question may interest several modelers.
Below is a copy of the  UML specification, v1.4.2 (formal/05-04-01), "les canons d'UML" as Christophe said. It can be found on the OMG web site (http://www.omg.org/technology/documents/modeling_spec_catalog.htm#UML) :

DERIVED ELEMENT

5.30.1 Semantics

A derived element is one that can be computed from another one, but that is shown for clarity or that is included for design purposes even though it adds no semantic information.

5.30.2 Notation

A derived element is shown by placing a slash (/) in front of the name of the derived element, such as an attribute or a rolename.

5.30.3 Style guidelines

The details of computing a derived element can be specified by a dependency with the stereotype «derived». Usually it is convenient in the notation to suppress the dependency arrow and simply place a constraint string near the derived element, although the arrow can be included when it is helpful.


So, the best solution is to add a / in front of the role name of your derived association.
The doc contains an example :
< img src="cid:part1.05010807.01000900@cirad.fr" v:shapes="_x0000_i1025" height="374" width="530">
It means that
    (1), the "age" attribute is redefined at the level of Person class;
    (2), the association "workFor" is redondant for clarity purpose : a Person works for a Dept, and consequently for a Company.
In your case, I would design it as following :



For clarity purpose, I think it is better to change the association color in grey for example.
But as it is written in the official doc, you can also use generalisation arrows to redefine the associations, but that will overload the diagram :


In my point of view, it is good to respect the UML specifications, but the most important is to be as clear as possible. To open the "black box", our models have to be understandable in order to be refutable and/or reimplemented.

A bientôt, et le bonjour à votre nouvelle recrue !
    Pierre

Christophe Le Page a écrit :

Je suis déçu… Tu aurais pu choisir «Funboard » et « wind »…

J

 

Dans ce cas de figure, je pense qu’on doit être redondant.

Si les classes générales sont abstraites, je ne vois pas ce qui pourrait prêter à confusion.

C’est simplement un moyen de rappeler que pour tout futur ajout d’une nouvelle spécialisation de « Véhicule », il faudra penser à préciser son association avec une spécialisation de « SourceEnergie ».

Ce n’est qu’un avis personnel, je ne sais pas ce que préconisent les canons d’UML!

 

Clp

 

-----Message d'origine-----
De : owner-cormas@cirad.cirad.fr [mailto:owner-cormas@cirad.cirad.fr] De la part de Barreteau Olivier
Envoyé : jeudi 28 septembre 2006 17:01
À : cormas@cirad.fr
Objet : question UML

 

Bonjour

 

Dans un diagramme de classe, comment se gèrent les héritages d’association ?

Exemple alors qu’il y a toujours association entre deux classes générales, on va dire Vehicule et SourceEnergie

Comment je peux dire que cette association n’est transférée car certaines sous-classes : par exemple si Velo et Auto héritent de Vehicule, et Moteur et Muscle héritent de SourceEnergie, seules deux associations au niveau des sous classes sont acceptables et non les quatre combinaisons envisageables.

 

Est-ce possible d’être redondant en marquant les associations aux deux niveaux ? ou est-ce que mettre l’association au niveau de la superclasse signifie qu’il peut y avoir une association entre Auto et Muscle (et je me place dans un monde où la voiture à pédales n’existe pas !)

 

Merci de vos conseils et expérience, je n’ai pas trouvé de cours UML très avancé sur Internet !

 

Olivier


No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.8/455 - Release Date: 22/9/2006

-- 
--------------------------------
Pierre Bommel - CIRAD - UR Green
Universidade de Brasília - CDS
SHIS QI 26, Conj. 15, Cs 18
71670-150
Brasília DF
tel : (00 55 61) 3367 3405
http://www.cirad.fr/ur/green
-------------------------------- 
clip_image002.jpg UMLassociationDerivee.JPG UMLassociationDerivee2.JPG

New Message Reply Date view Thread view Subject view Author view
 

Back to home