Dependency Relationships

A dependency relationship indicates that a change to one model element (the supplier) may cause a change in the other model element (the consumer). The supplier model element is independent because a change in the consumer does not affect it. In contrast, the consumer model element is dependent on the supplier model element because a change to the supplier may also affect it.

In an e-commerce application, for example, a "Cart" class depends on a "Product" class because the "Product" class is used as a parameter for an "add" operation in the "Cart" class. In a class diagram, a dependency relationship points from the "Cart" class to the "Product" class. In other words, the "Cart" class is the consumer model element, and the "Product" class is the supplier model element. This relationship indicates that a change to the "Product" class may require a change to the "Cart" class.


Connector

A dependency appears as a dashed line with an open arrow. It points from the consumer model element to the supplier model element.


Types of Dependency Relationships

Because a dependency relationship may represent several different types of relationships, you typically use a keyword or stereotype to show the precise nature of the dependency.

Type

Keyword/Stereotype

Description

Abstraction

«abstraction», «derive», «realize», «refine», or «trace»

Relates two model elements or sets of model elements that represent the same concept at different levels of abstraction or from different viewpoints.

Binding

«bind»

Binds template arguments to template parameters in order to create model elements from templates.

Permission

«access», «friend», or «import»

Grants permission for one model element to reference the model elements owned by another model element.

Usage

«call», «create», «friendusage», «instantiate», «send», or «use»

Indicates that one model element requires the presence of another model element for its correct implementation or functioning.

Note   A number of relationships use a connector similar to that of a dependency relationship but are not considered types of dependency relationships. These relationships include Extend Relationships, Include Relationships, and Note Attachments.


Using Dependency Relationships

You can add dependency relationships to your model to do the following:

The dependency relationships in a model appear in a variety of diagrams, including class, component, deployment, and use-case diagrams.


Related Topics



Comments ( )
<00>  <01>  <02>  <03>  <04>  <05>  <06>  <07>  <08>  <09>  <10>  <11>  <12>  <13>  <14>  <15>  <16>  <17>  <18>  <19>  <20>  <21>  <22>  <23
Link to this page: //www.vb-net.com/dotnet/relation/Dependency.htm
<SITEMAP>  <MVC>  <ASP>  <NET>  <DATA>  <KIOSK>  <FLEX>  <SQL>  <NOTES>  <LINUX>  <MONO>  <FREEWARE>  <DOCS>  <ENG>  <CHAT ME>  <ABOUT ME>  < THANKS ME>