Book a Demo

Author Topic: Modeling asociations and Java<--> UML synch  (Read 2076 times)

PLANORIT

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Modeling asociations and Java<--> UML synch
« on: December 08, 2008, 08:15:59 pm »
Dear all,
I intend to use EA while coding and perform regular synchronization code-> model and vice versa.
If I model for example a bidirectional relationship from
A (1)<---->(1.*) B, EA generates correct Java code like :

public class A {
  List theBroleName;  
}
public class B {
  A roleNameForA;
}

If I touch the Java code for adding methods, for example, then I want to synchronize from Java to model. I have noticed that apart from the asociation link in the diagram, now the model shows in the attributes section the attributes for classes in the association.
If the model shows the association as a visual link (line), isn't it redundant to show the target asociated class as an attribute of the source class and vice versa ?
This leads me to the following question : if I model without reverse engineering, shall i show associations as visual elements or must I also define the asociated class as an attribute? Is it correct to show both?
Thanks and regards,
Planorit.