how represent include/extends for communication diagram in UML

2.1k views Asked by At

I know how show extends or include and other stuff for sequence diagram but did not find anything to show include/extends in communication diagram?

is there any method for it or I should repeat every include for all of my use cases?

and also what about representing if condition ?

edit: this link is ibm tutorial about how represent if/include/extends in sequence diagram

2

There are 2 answers

0
Vladimir On

Only one element (I can imagine) in sequence diagram that can represent including or extending is Interaction Use. Anyway, it cannot be a proper representation for all cases. UML does not define Interaction Use in communications diagram.There are more missing elements there as well, (Combined Fragment (used to define If else condition), General Ordering, Found Lost message etc.)

0
xmojmr On

I'm not sure if there is an established/recommended way to avoid copy/pasting in UML Communication Diagrams. Probably there isn't because of this paragraph in UML 2.5 Beta 2 specification:

Source: http://www.omg.org/spec/UML/2.5/Beta2/PDF

17.9 Communication Diagrams

...Communication Diagrams correspond to simple Sequence Diagrams that use none of the structuring mechanisms such as InteractionUses and CombinedFragments...

In UML Sequence Diagrams you can use fragment with ref operator (interaction use) to indicate that another diagram should be "pasted" here.

Considering this example sequence diagram:

enter image description here

corresponding Communication Diagram might look like this:

enter image description here

Note that in the above diagram:

  • message 0.4 represents simplified message flow. Details of the Send Report interaction are not shown
  • messages 0.2 and 0.3 contain guard expressions which are used to represent if branching

More readable representation of complex if branches can be achieved by using the decision node notation as shown in the UML Interaction Overview Diagram below:

enter image description here

Note that the above diagram uses inlined "pasted" interaction Send Report. Instead of showing the interaction details you can use simple interaction use notation same as in the first diagram above.


Disclaimer: the diagrams are not perfect and may be they are not even correct. Use at your own risk