Information Technology Reference
In-Depth Information
Fig. 3.7
Generalization
Vehicle
cargo
Passenger
Utility
3.3.2 Generalization
Generalization is another type of relationship that can be described using UML.
Generalization describes inheritance, which we previously described as a rela-
tionship in which a class is derived from a more generalized version of itself. The
figure below denotes a superclass, Vehicle , that has two child classes, Pas-
senger and Utility . The relationship is denoted by a solid line with an
arrowhead that points to the superclass (Fig. 3.7 ).
Earlier in the topic, we explained that an inheritance hierarchy was a path of
related classes. The starting point on this path has the greatest amount of gener-
alization, and the derived classes become more specific as they move along it. In
UML diagrams of generalization, the arrow will always point toward the more
general end of the hierarchy.
3.3.3 Dependency
A dependency relationship occurs when one entity depends upon or requires the
resources of another. Real life examples of this include a bank account, which
requires a bank, or a flashlight, which is dependent upon a battery to work. In UML,
dependency is indicated by a dashed line, with an arrow at one or both ends. The
arrow originates from the independent entity, and points toward the entity that is
dependent. In other words, the entity at the tail end of the arrow is dependent upon the
entity that is being pointed to. An entity indicator with an arrow at both ends depicts a
relationship in which both objects are dependent upon each other, signifying co-
dependency. In a dependency relationship, changes to the independent entity will
have an effect on the dependent entity. Figure 3.8 illustrates such a relationship.
3.3.4 Uses and Extends
Uses and Extends are two types of relationships utilized in use case diagrams. The
first, uses, specifies that the semantics of the source element are dependent upon
the semantics of the public portion of the target element. The second, extends,
Search WWH ::




Custom Search