|
Drawing connectors between portsIn 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
with the diagram where only the ports and their connections are shown
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:
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 interfacesThe 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.
Instead one has to
|