Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Depicting friend relationship between classes in UML

Tags:

uml

friend

I have two classes A and B where B is a friend of A.

How to show this in UML ?

Is it ok to show it using dependency relation and then adding a comment on the relation like below ?

  <<Friend>>

B ------------------> A

like image 964
Arun Avatar asked Jun 12 '12 08:06

Arun


People also ask

Which UML diagram represents the relationship among the classes?

Class diagrams are the main building block in object-oriented modeling. They are used to show the different objects in a system, their attributes, their operations, and the relationships among them.

What does a relationship in UML diagram depict?

Relationships depict a connection between several things, such as structural, behavioral, or grouping things in the unified modeling language. Since it is termed as a link, it demonstrates how things are interrelated to each other at the time of system execution.

What is a diagram used to describe the relationship between classes and objects?

Class diagrams are the blueprints of your system or subsystem. You can use class diagrams to model the objects that make up the system, to display the relationships between the objects, and to describe what those objects do and the services that they provide. Class diagrams are useful in many stages of system design.


1 Answers

Yes, that's perfectly valid. For my own questions about UML, I found this website particularly helpful.

like image 73
Gnosophilon Avatar answered Oct 23 '22 11:10

Gnosophilon