Book a Demo

Author Topic: Agregation/composition direction  (Read 2946 times)

kamil.svoboda

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Agregation/composition direction
« on: January 30, 2005, 03:02:33 am »
Hi all,
I don't understand why I have to draw agregation between two classes in oposite direction (from target to source) :(
UML Specification defines that the diamond has to be on the source side (this class containes target class)... But EA draw diamond on the target side of relation...
Thanx
Kamil


kamil.svoboda

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Re: Agregation/composition direction
« Reply #2 on: January 31, 2005, 12:40:40 am »
I understand this explanation, but I thing the EA approach is not good yet.
If you want to draw the relation like that (this is example from UML 2.0 Superstructure, page 86 and widely used approach),

| Class1 | <-----------<> | Class2  |

You have to set relation direction "Destination to source" and then EA generate source code incorrectly:
public class Class1 {
public List class1;
public Class1(){
}
}
public class Class2 {
public List class1;
public Class2(){
}
}

Kamil
Quote
Quote
Quote
« Last Edit: January 31, 2005, 12:45:54 am by kamil.svoboda »