Can I use a communication diagram for a high-level view?

445 Views Asked by At

Is it correct to use a communication diagram to model communication between packages rather than communication between objects? I would like to model communication at a higher level, but I would not like to misuse the diagram. As an example, I show you a use case modeled with both diagrams. In the sequence diagram all the objects appear, as it is realized in detail, while the communication one offers a higher level view. I would like to know if it is conceptually correct. enter image description here enter image description here

1

There are 1 best solutions below

1
On

Is it really about UML package?

UML defines a package as a means to pack things together in a namespace:

A Package is a namespace for its members, which comprise those elements associated via packagedElement (which are said to be owned or contained), and those imported.

UML provides means to use dependencies between packages, to merge names of packages, and things like that. But a package has by itself no behavior and therefore cannot communicate.

Could it be components?

Your diagram however suggests a classifier with some form of communication and behavior. The names of your "packages" seem to suggest something more complex than a simple class.

UML defines components:

A Component represents a modular part of a system that encapsulates its contents and whose manifestation is replaceable within its environment.

UML components have 2 important characteristics:

  • they are self contained, i.e. they depend on other elements and other elements depend on them only via well-defined interfaces.
  • they are substituable, i.e. a component could be replaced by another component that offers the same "contract", provided they use and offer the same interfaces.

In practice, it may happen that some component boundaries match package boundaries (by coincidence?), which might create some terminological confusion.

Communication diagrams

If what you call "packages" matches in reality UML components, especially with a view to the 2 characteristics, you may perfectly consider communication diagrams as you did.

Unrelated side remark: I know this is a common practice. But in principle interaction diagrams such as sequence diagrams and communication diagrams show "units of behavior of an enclosing classifier", i.e. something that is in principle inside of the system, whereas an actor is by definition outside.