Previous UML Classes Table of Contents UML Packages Next


7.3.12 Dependency

Dependencies


*Generalizations

   

    DirectedRelationship (from Kernel ) on page 62

   

    PackageableElement (from Kernel ) on page 111

*Description

   A dependency is a relationship that signifies that a single or a set of model elements requires other model elements for their specification or implementation. This means that the complete semantics of the depending elements is either semantically or structurally dependent on the definition of the supplier element(s).

*Attributes

   No additional attributes

*Associations

Issue 8019 -Add subsetting constraints to Dependency ::client and Dependency ::supplier.

   Abstraction s), a common convention in the domain of class-based OO software is to put the more abstract element in this role. Despite this convention, users of UML may stipulate a sense of dependency suitable for their domain, which makes a more abstract element dependent on that which is more specific. Subsets DirectedRelationship ::target.

*Constraints

   No additional constraints

*Semantics

   A dependency signifies a supplier/client relationship between model elements where the modification of the supplier may impact the client model elements. A dependency implies the semantics of the client is not complete without the supplier. The presence of dependency relationships in a model does not have any runtime semantics implications, it is all given in terms of the model-elements that participate in the relationship, not in terms of their instances.

*Notation

   A dependency is shown as a dashed arrow between two model elements. The model element at the tail of the arrow (the client) depends on the model element at the arrowhead (the supplier). The arrow may be labeled with an optional stereotype and an optional name. It is possible to have a set of elements for the client or supplier. In this case, one or more arrows with their tails on the clients are connected to the tails of one or more arrows with their heads on the suppliers. A small dot can be placed on the junction if desired. A note on the dependency should be attached at the junction point.


   Figure 7.37 - Notation for a dependency between two elements

*Examples

Issue 8091 -Correct example text.

   In the example below, the Car class has a dependency on the CarFactory class. In this case, the dependency is an instantiate dependency, where the Car class is an instance of the CarFactory class.

   CarFactory

   «instantiate»


   Figure 7.38 - An example of an instantiate dependency