Book a Demo

Author Topic: Reverse engineering - Java Generics  (Read 3744 times)

genuinefafa

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Reverse engineering - Java Generics
« on: June 23, 2008, 10:10:29 am »
I am trying to reverse engineer a JDK 1.5 based Java Project.

Everything works great (as expected comming from EA) but i found a little problem with aggregation / composition.

The Class Diagram automatically created do not detect relationship between classes when I use Generics.

Example:
Class: Customer has List<Order>
Class: Order

Order is an agregation (or composition) of Customer, but EA do not notice that and i need to do this manually.
The project is really big and I do care about that feature.

The strange thing is that I found browsing the web many sites that claim EA support Generics I am unaware if it does when doing reverse engineer. Maybe EA doesn't support this?

Any help will be greately apreciated. :)

« Last Edit: June 23, 2008, 10:12:26 am by genuinefafa »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Reverse engineering - Java Generics
« Reply #1 on: June 23, 2008, 10:19:09 am »
EA can model the associations you are describing through use of collection classes (http://www.sparxsystems.com/EAUserGuide/index.html?settingcollectionclasses.htm)  These set how relationships with multiplicity greater than one are generated and can be specified for each language or all associations to individual classes.  For associations where the multiplicity is one, you can only set this by setting the Member Type on the association.

EA currently only creates associations and dependency relationships from code where it finds that a type used in one class directly matches the name of another class.  It currently does not look at the types used as template/generic arguments or attempt to distinguish between when the template class itself should be the target of an association, or if it is acting as a container.

We plan on addressing these limitations and adding the capability of reverse engineering an association or dependency to the class used in a containing template.  However, at this stage the details of this or a release schedule are unavailable.