Component Diagram - Example

Suppose that we need to build up a software for playing a music from a CD-ROM Drive. A visual programming language might be used (VisualBasic or Delphi for example). If language supports multimedia controls, than we can use its components an reprogramm them if necessary, or we can programm new components. One possible graphical design for our player might be:

componentDiagram1.GIF (5331 bytes)

As you can see this UML Music Player needs these controls:

tri.gif (105 bytes) play
tri.gif (105 bytes) stop
tri.gif (105 bytes) eject
tri.gif (105 bytes) pause
tri.gif (105 bytes) fast forward
tri.gif (105 bytes) rewind
tri.gif (105 bytes) power

These controls will be realized by buttons, thus we'll have a button performing these controls. If we look at buttons as separete components, we can draw out a component UML diagram. This is shown on the following picture:

componentDiagram2 The component diagram for the MusicPlayer.

All the components shown on the previous diagram belongs to one global component - Button, but actions they perform are diferent. We must obtain these actions by programming them.