Component Diagram represents the relationship between SW components. To represent a component with a  diagram, use a <<component>> title or SW component icon, or use both.

Ports are  squares on the component boundary that determine the interaction of the component with the environment. These contain visibility attributes, public when the square is between the interior and exterior of the component, and private when the square is totally inside the component.

The notation of services in a component interface is called socket/ball. A ball indicates the functionality that the component offers to the outside world, while the socket is a functionality that the component needs from the outside world. The interface ports can be grouped to display common interfaces when there are too much of them to illustrate in the diagram.

When a component is complex (it contains several components within it), it is called a subsystem and should denote <<subsystem>> instead of <<component>>

Component-Diag-1

If more detail of the interfaces is needed, the following notation can also be used:

You can define a notation of the relationship of the component with its classes. With the dependency relation <<realize>> where the arrow head goes to the component from the class.