Created December 31, 2009
Last updated December 31, 2009
[ Japanese | English ]

Dependency

  In this page, I will explain the dependency in the class diagram1.
  When I began to study the UML , I could not understand the dependency. Because , It is not written in the book so much.
  But , when we design the software , there are often the dependencies. After all, I was troubled because I had no idea.
  To decrease person like past me , I created this page.

-----
Note.
1: In this page , I will explain supposing that you know the UML a little. But , whether you don't know the UML , I will try so that you can understand. And , in this page , the UML version is 2.0.


1. What is the dependency?
2. The example of the dependency
3. How much the dependency should be drawn in the class diagram?
4. Reference


1. What is the dependency?

  The dependency 1 means that when a element 2 is changed , other element is dependent 3.
  
  When the ClassA is dependent on the ClassB , this is noted by the arrow of short dashed line like in the Figure 1.

dependency
Figure 1 - The notation of the dependency ( When the ClassA is dependent on the ClassB )

  When the ClassA is dependent on the ClassB and the ClassB is dependent on the ClassA ( When bidirectional dependency) , this is noted like in the Figure 2.

dependency ( bidirectional )
Figure 2 - When bidirectional dependency


-----
Note.
1: If you need the details , please read the Fig7.17 on the page 32 and the "7.3.12 Dependency (from Dependencies)" on the page 58 in the UML2.0 Sepecification.
2: The element means all things composing the model. For example , there are the class , operation , comment , association and so on in the class diagram . And there are the actor , usecase and so on in the usecase diagram.
  If you need the details of the element , please read the Fig7.3 on the page 23 and "7.3.14 Element (from Kernel)" on the page 60 in the UML2.0 Sepecification.
  If you think to take an examination of the OCUP Fandamental , I think that you should stuty it.
3: Because I had the course that I only explained the dependency in the class diagram , I supplement. Actually , the dependency is able to be used expect between the classes too ( it is able to be used between named elements ) .
Back to Top

2. The example of the dependency

  The following are the examples that the ClassA is dependent on the ClassB ( the examples of the Figure 1 ).
-----
Note.
1: If you need the details , please read the Fig7.15 on the page 32 and the "7.3.53 Usage (from Dependencies)" on the page 131 in the UML2.0 Sepecification.
2: Properly speaking , there may be associations from the ClassA to the ClassB. But in this case, the arrow of the dependency is not drawn in the class diagram. Because , when there are associations , the class is used ( because we can understand without the arrow of the dependency, it is not drawn.).
3: I wrote "the exception type" , but in the VBA , it is only the ErrOjbect. ... Then , in this case , even if you describe in the class diagram , I think that there are no means.
4: If you need the details , please read the Fig7.15 on the page 32 and the "7.3.45 Realization (from Dependencies)" on the page 124 in the UML2.0 Sepecification.
Back to Top

3. How much the dependency should be drawn in the class diagram?

  When I began to study the UML , I think that the all arrow of the dependency must be drawn. But , if I do so , the class diagram that I draw become unreadable.
  Therefore, now , I think the following.
  1. First of all , I determine the things that I want to inform in the class diagram. For example , when I create the Word document , I determine the things that I want to inform . And this is in the class diagram also.
    If I understand without the arrow of the dependency 1, I don't draw.

  2. When there is already the class diagram , I will fit it.
    ( The details degree is matched to based class diagram. )
    If there are some other rule , I will fit it.
    But , this is not abusolute. If a dependency is important, I will draw it.

  3. When I want to draw the detail class diagram, I will draw many dependencies. In this case , I will divide the class diagram 2. Because it is impossible to inform by one class diagram, I think that it may be divided. If it is still unreadable so that unordered , I will not draw ( or write ) the obvious element ( for example , if the return value or parameter of the operation is written , I can understand without the arrow of the dependency.)
-----
Note.
1: I wrote "without the arrow of the dependency". And , This is not only the dependency , this is the operation , attribute and so on too.
2: After I divide the class diagram , I will sure do determine the things that I want to inform in the divided class diagram.
Back to Top

4. Reference

  The following tables are pages that I referred to create this page.

No.

Linked Website Name

Description

Linked date

1

OMG Document -- You can download the UML Superstructure Specification, v2.0. December 31, 2009

Prev Up Next  Top
Back to Top

I doesn't assume the responsibility of any damage that occurs because of the use of this page.

Microsoft ,Windows ,Visual Basic and Excel are registered trademarks of Microsoft Corporation in the United States and other countries.
Visual Basic® for Applications may represent a VBA.
Mac ,Mac OS ,Mac OS X ,AppleScript are trademarks of Apple Inc., registerd in the U.S. and other countries.
UML ,Unified Modeling Language are trademarks of Object Management Group Inc. in the U.S. and other countries.
The UML diagrams in the page are created by SystemDirector Application Modeler UML Editor V2.0 made by NEC Corporation.
Other brands and their products are trademarks or registered trademarks of their respective holders and should be noted as such.

The author of this page and these companies do not have any relationship.