UML Guide v2.1
Author: Rajinder Yadav
Date: Oct 8, 2007
UML Component Element
A component is a piece of software that provides an interface and a body. The interface provides the means to interact with the component. The body provides the implementation for the component. A class is one type of component since it provided a body(behaviour) and an interface(methods). A true component support a published interface, the interface separates implementation details from interaction contracts. A UML component element is made from a box with an interface shown as a line having a circle at the terminal end.
 Diagram 1 - Component
The class representation of the same component is depicted below. The class diagram representation is more implementation detailed oriented than the component diagram, and may show other class relationships that are required to create a given component.
 Diagram 2 - Component
Component diagrams show the a more general view of the choice made in the software architecture. It also shows how the components fit in the implementation environment. Components are usually well defined and designed to carry out a specific task, such as managing network communication, providing spell checking, or file handling operations. Components can interact with other components. To show this, a dependency arrow depicting a "uses" relationship is drawn from the controlling component to the controlled component.
 Diagram 3 - Component Dependency
Components support the Design by Contract to a lesser degree the Substitution Principle. Component diagrams can show hierarchal relationship like the class diagrams as well as association using aggregation and composition to show relationship with sub-components.
The building blocks of a component is the class and interface, and the component model is used to model a system or sub-system in the implementation environment.
Component Ports
A port is a connection point that is defined by it's category and usually defines a communication channel. A port can be bidirectional or unidirectional defining a read-only or write-only policy. Ports can be named to identify their category such as, "Security" or "Event". A port is shown as a small box attached to the component. Since a port defines a category, it may define one or more interfaces to provide. Diagram 3 is shown again with a "network" port, the port provides an interface to send and receive network data with the external world.
 Diagram 4 - Component Port
Examples of components in use today are:
- Microsoft COM/DCOM (Component Object Model)
- OMG's CORBA (Common Object Request Broker Architecture)
- Sun's Java Beans
Copyright © 2007 Rajinder Yadav, All rights reserved
UML logo are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries
|