A colleague of mine did this UML component diagram to represent both the required/provided interfaces and the internal structure of the subsystems that compose the system we're working on:
(The subsystems are called "User Management", "Votes Management", "Post Management", etc...)
This diagram is for a System Design Document. This is therefore not an exact representation of the code objects.
The system follows a 3 layer approach:
- GUI represents the User Interface
- Control represents the application logic
- Repository and media access are required interface given by some other components that represent the Data Access.
Each component in the figure above has their own GUI and Control subcomponent. The repository is a monolithic component outside of this diagram so we're just ignoring it.
The question is: does it make sense that "GUI" and "Control" are instances, while "Gestione Utenti", "Gestione Voti", ecc... are not? My colleague states that this is useful to intend that "each GUI subcomponent is different from the GUI subcomponent elsewhere in the diagram". So there is another question: does it make sense that there are multiple "GUI" and "Control" subcomponents with the same name?
instanceName:Component
(underlined), where "Component" really plays the role of some kind of an abstract type (components are meant to be substitutable). But you may omit the typeinstanceName
or the name:ComponentType
if one or the other is not important for what the diagram is trying to communicate. 1/2:GUI
would, strictly speaking, indicate an unnamed instance that has the abstract type "GUI" (i.e., an instance of GUI component), but the concrete GUI realizations depicted may be different from each other. This would mean that all of the parent components work with their GUI subcomponent in the same way (see and call the same sorts of methods, use the same interface), but that the GUI components themselves differ in what they do internally and/or in how they are wired up with Control "behind the scenes". Your colleague may have intended something less formal, though. 2/2