views:

1244

answers:

3

Hello,

I have recently been studying UML and drawing simple diagrams with ordinary plain arrows between classes. But I know its not enought, there is plenty other arrows generalization, realization and etc which has meaning to the diagram reader. Maybe is there a nice resource which could explain each arrow(ordinary,plain, dotted, diamond filled, diamond)? It would be the best if it will have some code examples for them :) Thanks in advance!

+4  A: 

My favourite UML "cheat sheet" is UML Distilled, by Martin Fowler. It's the only one of his books that I've read that I do recommend, however.

anon
Interesting, I quite liked Refactoring. Is that one you have opinions on.
djna
Yes, I found it all a bit obvious, and didn't like the concentration on Java. Also, please don't take my answer as saying that his other books are rubbish.
anon
Fowler's book also has a cheat sheet on the inside of the book covers. Really good for starting out, especially as your next question will be what direction do the arrows go?
Ted Johnson
+3  A: 

Here is simplified tutorial, for more i recommend to get some literature:

Practical UML

Siblja
+7  A: 

Here's some explanations from the VS 2010 Ultimate docs:

UML Class Diagrams: Reference: http://msdn.microsoft.com/en-us/library/dd409437%28VS.100%29.aspx

UML class diagram

5: Association: A relationship between the members of two classifiers.

5a: Aggregation: An association representing a shared ownership relationship. The Aggregation property of the owner role is set to Shared.

5b: Composition: An association representing a whole-part relationship. The Aggregation property of the owner role is set to Composite.

9: Generalization: The specific classifier inherits part of its definition from the general classifier. The general classifier is at the arrow end of the connector. Attributes, associations, and operations are inherited by the specific classifier. Use the Inheritance tool to create a generalization between two classifiers.

alt text

13: Import: A relationship between packages, indicating that one package includes all the definitions of another.

14: Dependency: The definition or implementation of the dependent classifier might change if the classifier at the arrowhead end is changed.

alt text

15: Realization: The class implements the operations and attributes defined by the interface. Use the Inheritance tool to create a realization between a class and an interface.

16: Realization: An alternative presentation of the same relationship. The label on the lollipop symbol identifies the interface.

UML Class Diagrams: Guidelines: http://msdn.microsoft.com/en-us/library/dd409416%28VS.100%29.aspx

Properties of an Association

Aggregation: This appears as a diamond shape at one end of the connector. You can use it to indicate that instances at the aggregating role own or contain instances of the other.

Is Navigable: If true for only one role, an arrow appears in the navigable direction. You can use this to indicate navigability of links and database relations in the software.


Generalization: Generalization means that the specializing or derived type inherits attributes, operations, and associations of the general or base type. The general type appears at the arrowhead end of the relationship.

Realization: Realization means that a class implements the attributes and operations specified by the interface. The interface is at the arrow end of the connector.

Let me know if you have more questions.

Esther Fan - MSFT
thnx, I'll try :)
faya
@Esther: good cheat sheet - with pictures!
John Saunders