Search code examples
umlrelationshipclass-diagramcircular-reference

circular reference in class diagram


I have five database tables:

  • documentTemplate
  • area
  • Zone
  • KeyWord
  • DocumentField

a document template is composed of areas an area is composed of zones a documentTemplate is composed of keyWords

zones and keyWords belong to a Field ( documentField ) this is my class diagram : enter image description here how do i split the circular reference between these tables ? thank you in advance for your help


Solution

  • A simple way is to make both associations of DocumentField unidirectional (either towards DocumentField or vice versa).

    Bidirectional associations are a common source of circular dependencies in a model and should be rarely used - basically between very close elements in the same scope. Then they cannot cause this kind of problems.

    If this solution is not good for you, I suggest to try to break this 5 classes in 2 or 3 packages and then concentrate on removing circular dependencies between the packages and not single classes.