Component Diagrams and MagicDraw

Drawing connectors between ports
Lollipop Notation in MagicDraw: Connecting provided and required interfaces

Drawing connectors between ports

In particular with complex component diagrams, one would like to hide the information flow between components that is shown by providing and connecting explicitly the provided and required interfaces of ports to more clearly show the connection of the components.

Compare the diagram of the BankATM component with explicit connections of provided and required interfaces

[BankATM component with explicit connections of provided and required interfaces]

with the diagram where only the ports and their connections are shown

[BankATM component with connectors between ports]

The former shows that messages are send from the ATM to the Bank but also that messages are sent from the bank to the ATM. The disadvantage is that the primary information of a component diagram, which cmoponents are connectet, is not as clearly visible anymore. The second diagram only shows how components are connected via ports, and that makes more complex component diagram more clearly arranged and thus preferrable.

However, it is not directly possible to draw the latter diagram in MagicDraw, as both do not allow to connect the ports of components in class/component diagrams.

The solution is to use composite structure diagrams instead. The best way to do this is to create the components in a component diagram, then create a new composite structure diagram for the super component.

In MagicDraw< you drag and drop the components/classes that you want to use in the composite structure diagram directly from the tree view in the diagram, and then MagicDraw is doing the rest for you automatically.

The resulting diagram looks like:

[BankATM component as a composite structure diagram]

Note the difference between the component diagram from the lecture and the composite structure diagram. The component diagram referes to component types while the composite structure diagram refers to an instance/role of a component, shown by the leading colon ":" in front of the component names.

Lollipop Notation in MagicDraw: Connecting provided and required interfaces

The most obvious way to create provided and required interfaces with ports does not automatically connect the provided interface of one port with the required interface of another port. That is, if one clicks on the port, a menu with icons opens of which one icon allows one to set/create provided and required interfaces.

[diagram 1]

Instead one has to

  1. first create the interface in the diagram and right click on the interface and then select as presentation options: suppress operatios and suppress attributes. This results in showing the interface as a circle instead of as a box.
  2. After one has done this, one has to set the port type of both ports to a class. Otherwise, one won't get the right menu options in the next step.
  3. In the next step, by clicking on the port, one gets a menu that allows one to set the interface the port uses

    [diagram 2]

    and also the interface that the port provides.

    [diagram 3]

The result is the correct connection using the lollipop notation.

[diagram 4]


Part of 02291: System Integration
Hubert Baumeister
April 17, 2018