Book a Demo

Author Topic: Reverse Engineering C#  (Read 3207 times)

ajaxx

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Reverse Engineering C#
« on: October 24, 2007, 07:44:54 am »
I recently performed a reverse engineering operation on my C# code and found that it didn't do what I wanted it to do with my generic datastructures.  In this case, A had a member foo which was of type List<B>.  The diagram shows both A and B but was unable to show an association between A and B that would have been qualified by multiplicity.

So I went in and added an association between A and B with a 1 to * multiplicity.  Set the visibility to private and it generated a member B inside of A.  Not completely unexpected, but I'm unclear about how I can tell the forward engineering template that I would like it to use a List<T> when an unordered 1 to * multiplicity is specified.

Any thoughts on how I can make the reverse engineered diagram more useful?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Reverse Engineering C#
« Reply #1 on: October 24, 2007, 02:01:29 pm »
EA can model the associations you are describing through use of collection classes. (See 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 issues 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.