Component diagram in UML
Component diagram represents set of components and their relationships. It basically includes components, interfaces and their relationships in the diagram.
We can use this type of diagram in
Modeling source code,
Modeling executable releases,
Modeling Physical databases,
Modeling adaptable system.
Explain all elements of a Component diagram.
Elements of a component diagram:
Rectangle: A single component is described using a rectangle and having the component’s name inside it. <<Component>>Component Name
Additional compartments: Additional compartments are stacked below the component name.
Interfaces provided/required: Another compartment exists for displaying the interface provided and required by the component.
Relationships: A lollipop and socket notation is used along with showing dependency arrows. Dependency arrow points towards the needed socket and arrowhead connects with provider’s lollipop.
Subsystem: A subsystem is represented using a rectangle with stereotype <> subsystem name.