Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to depict "class uses class" relationship via UML

Tags:

Case A Say you have 2 classes Model and Settings.

Settings contains nothing but public static constants used throughout the application. What type of relationship would you say these 2 classes have?

Case B Say you have a IntersectionManager singleton class that is being used by classes Road and Car to get some data out of it.

What is the name of "class uses class" relationship in UML?

Would you use the same relationships for both case A and case B? What UML arrow would you use to demonstrate this relationship?

like image 735
James Raitsev Avatar asked Nov 13 '11 22:11

James Raitsev


People also ask

How do you show relationships in UML class diagram?

To show a composition relationship in a UML diagram, use a directional line connecting the two classes, with a filled diamond shape adjacent to the container class and the directional arrow to the contained class.

Can UML represent relationships between classes?

A UML relationship is a type of model element that adds semantics to a model by defining the structure and behavior between model elements. You can set properties and use keywords to create variations of these relationships. Relationships in class diagrams show the interaction between classes and classifiers.

How do you represent a class in the UML?

In UML, a class represents an object or a set of objects that share a common structure and behavior. They're represented by a rectangle that includes rows of the class name, its attributes, and its operations.


1 Answers

Well, you could use the "uses" relationship (dotted or dashed line, open arrow). I found a nice and helpful overview at http://usna86-techbits.blogspot.de/2012/11/uml-class-diagram-relationships.html.

like image 184
OBu Avatar answered Oct 12 '22 16:10

OBu