More About Interfaces and Components

In previous lessons, you learned about diagrams that deal with conceptual entities. In next lessons, you're going to learn about a UML diagram that represent a real-world entity: software component.

But what is a software component?
A software component is a physical part of a system. It resides in a computer, not in the mind of an analyst.

What's the relationship between a component and a class?
important.GIF (2288 bytes)Think of a component as the software implementation of a class. The class represents an abstraction of a set of attributes and operations. And one component can be implementation of more than one class.

You model components and their relationships so that:
1 Clients can see the structure in the finished system
2 Developers have a structure to work toward
3 Technical writers who have to provide documentation and help files can understand what they're writing about
4 You're ready for reuse

When you deal with components, you have to deal with their interfaces. Interface is the object's "face" to the outside world, so that other objects can ask the object to execute its operations, which are hiden with encapsulation.

An interface is a set of operations that specifies something about a class's behavior. It is a set of operations the a class represent to other classes. For you as a modeler, this means that the way you represent an interface for a class is the same as the way you represent an interface for a component. As is the case with a class and its interface, the relation between a component and its interface is called realization. See, Interfaces & Realizations.

note.GIF (411 bytes)You can replace one component with another if the new component conforms to the same interfaces as the old one. You can reuse a component in another system if the new system can access the reused component trough that component's interfaces.

As you progress in your modeling career, you'll deal with three kinds of components:
1 Deployment components, wich form the basis of executable systems (DLL's, executables, ActiveX controls, JavaBeans)
2 Work product components, from which deployment components are created (data files and source code files)
3 Execution components, created as result of a running system

Uml2.gif (2126 bytes)Instead of representing a conceptual entity such as a class or a state, a component diagram represents a real-world item - a software component. Software components reside in computers, not in the minds of analysts.
A component is accessible trough its interface. The relation between a component and its interface is called realization. When one component access the services of another, it uses an import interface. the component that realizes the interface with those services provides an export interface.