Depicting friend relationship between classes in UML

friend, uml

Solution

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

Problem

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

Original source