tags:

views:

29

answers:

2

What are the UML 2.0 rules regarding private/protected functions on sequence diagrams? Do we show them (those functions) on those diagrams? Are they marked in any special way to indicate that they aren't public?

A: 

Read this:

http://www.ibm.com/developerworks/rational/library/content/RationalEdge/sep04/bell/

Search for "visibility".

Table 4: Marks for UML-supported visibility types

Mark Visibility type
+    Public
#    Protected
-    Private
~    Package

Generally, this is only for class diagrams.

In a sequence diagram you have a choice.

  1. Show private function calls because you are documenting the implementation. You do this so the developer knows what code to write.

  2. Do not show private function calls because you are documenting the interface. You do this so everyone knows how the classes collaborate to get work done.

S.Lott
@S.Lott I've read some time ago this article and it does't explain about private and protected fnc in sequence diagram.
There is nothing we can do
A: 

To add to S.Lotts answer above specifically the point about including non - public behavior in a Sequence Diagram, in general , i would say No. However, it depends on exactly what you are going to be using these UML diagrams for.

If you are using these UML diagrams for communicating your API's to external users, then definitely it does not make sense to expose the internals of your system to them.

However, if you are using these diagrams to communicate internally amongst your team, then sometimes, i have found it useful to communicate low level design by depicting it in a sequence diagram as it gives a clear indication to the developers as to what the implementation is supposed to be like. Again, this need for doing this is greatly dependent on the skill level of the person doing the implementation.

InSane