-3

I'm wondering how does one include methods from private classes in a communication diagram UML? Do you only include the method even though it's from a private class or do you include the method and make some sort of note that the method is from a private class?

2 Answers2

1

Communication diagrams generally do not show public vs. private. If you want, I suppose you could add a stereotype <> to the class name to that effect. In the class diagram, nested private classes will be displayed using visibility marks. I think both diagrams are important for conveying your intent.

See: http://www.ibm.com/developerworks/rational/library/content/RationalEdge/sep04/bell/ and http://www.holub.com/goodies/uml/index.html

Bruce
  • 2,230
  • 18
  • 34
  • Certainly the message sent from `A→B` must be visible for `A`. It seems that communication diagrams don't care about packaging the lifelines into namespaces and about their mutual visibility at all (at least there's no such special notation mentioned in [www.omg.org/spec/UML/2.5/Beta2](http://www.omg.org/spec/UML/2.5/Beta2/)). Yet another see: [uml-diagrams.org: UML Communication Diagrams Overview](http://www.uml-diagrams.org/communication-diagrams.html) – xmojmr Mar 18 '15 at 21:58
0

All communication diagram (SD and AD) show the source of the message as the object itself and never the method from where the message is sent. You see only the methods that are called. And those are always public.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86