Book a Demo

Author Topic: Problems Reverse Engineering Code into EA model.  (Read 2381 times)

rseshadri

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Problems Reverse Engineering Code into EA model.
« on: September 20, 2005, 04:28:58 pm »
Hello All

I am a moderate EA user with EA 5 corporate license. I am having some problems around using the EA to the fullest .

model - generate code - reverse engineer - fix model - generate code cycle.

I have a C# project that I am working on. The model has several namespaces (the physical file exists as a natural association to its namespace - this may not be required for C# still it helps me keep the code directory clean) for example:

test
 |
 |-manager
 |  |-TestManager.cs
 |
 |-persistence
    |
    |-database
       |-TestDatabase.cs
    |
    |-file
       |-TestFile.cs

I create the model with the above provided sample namespace structure with classes.

The code generation from EA works fine - It creates the appropriate physical directory structure with associated C# files in the respective directory. I now have a test, test\manager\TestManager.cs, test\persistence\database\TestDatabase.cs, test\persistence\file\TestFile.cs

Cool!

I then proceed to make changes to the .cs files and added more code.

Now I want to reverse engineer the code changes back to my model. I would like to know the best approach to go about this. I tried using the “Import From Source File(s)” by right clicking on the existing class diagram – but I want to upload all (there are lots of classes in my current project and hence cannot go about importing single files) the files for my project in one single import.

I also tried the “Code Engineering – Import Source Directory” option – this solves my problem of importing lots of files but after I import I seem to face the below problems:

1) Some of the files appear twice in the model – one that has the recent changes I made to the source code and the older.

2) Some of the class diagrams that I already had in the model gets messed up or reformatted.

I believe To be missing in two critical areas and will need help:

1) At which level should I right click on the project view – should I right click at the “Logical View” level or at the “test” level – If my observation is right rightclicking at the “test” level ends up creating another test under the existing root (test).

2) Can someone explain me the difference between using the “Synchronization” options in the “Import Directory Structure” dialog. The “Synchronization” options are “Synchronize existing classes” or “Overwrite existing classes” – I would like to hear the variations absorbed by EA on the different options.

I would like to know if there are other best approaches to importing source code and remodeling in EA.

Thanks ahead for the help.

Thanks
Ram :)