Skip to main content

Dependency (UML)

A Dependency between a client (dependent) and a supplier (dependee) can be illustrated with a dashed line with its tail starting at the client and an open arrowhead ending at the supplier.

The notation is used to depict a Dependency between a client and a supplier: If the supplier changes, the client may have to change, too.

"A dependency indicates that an element on one end of the relationship, in some manner, depends on the element on the other end of the relationship." [📖OOA, p. 111]

Figure 1 The UML-notation for a Dependency. The stereotype indicates that Client requires Supplier for its implementation.

Dependency Relationship Keywords

While there are notations available with UML that can be used for other semantics and specifications, or that already imply a dependency (such as Associations, Aggregation or Composition ), the context of a basic Dependency can further be specified with one of the following keywords ([📖UML, p. 48] and [📖ADU, p. 288]):

Stereotype / KeywordRelationshipMeaning
«call»UsageThe client calls a method of the supplier
«create»UsageThe client creates instances of the supplier
«derive»AbstractionThe client is derived from the suplier
«instantiate»UsageThe client gets instantiated from the supplier. If the client is a class, the supplier is a metaclass
«permit»PermissionThe client has the permission to access the private members of the supplier
«realize»RealizationThe client realizes the supplier, e.g. if the supplier is an interface or an abstract element.
«refine»AbstractionThe client refines the semantic level of the supplier
«substitute»SubstitutionThe client can be substituted with the supplier, e.g. if they share the same type
«trace»AbstractionSemantical requirements are traceable from the client to the supplier
«use»UsageThe client requires the supplier for its implementation

Example

Figure 2 A Usage-Dependency: Button (client) calls a method of Observer (supplier). If Observer changes, Button has to change, too.
The source code may look like this (JavaScript):
    class Button {

click () {
const me = this;

me.observers.map(observer => observer.notify("click", me));
}

}