Book a Demo

Author Topic: duplicate code from forward engineering  (Read 2356 times)

Cryolitte

  • Guest
duplicate code from forward engineering
« on: April 05, 2005, 11:14:11 pm »
Hi all,

I've reverse engineered from some C# code that we have into an EA model through MDG plugin for VS.Net. After a little bit of test modifications to the model, I then forward engineered it to synchronize with the code.

The Merge option only seemed to pick up new entities, not changes within an entity, so I tried using the option Generate Code (forward engineer).

BUT... Why do I get duplicates of everything? Every method, inner structures...etc. are duplicated within the .cs file every time I run Generate Code (forward engineer)?


TIA

Cryolitte

  • Guest
Re: duplicate code from forward engineering
« Reply #1 on: April 06, 2005, 03:22:28 am »
Hmmm... Let me correct myself. After some testing with dummy VS.Net projects, it seems the problem is with C# struct.

For example...

Code: [Select]

class MyClass{
 public struct MyStruct{
   public string attr1;
   public string attr2;
 }
}


after forward engineering, the original code would be turned into...

Code: [Select]

class MyClass{
 public struct MyStruct{
   public string attr1;
   public string attr2;
 }

 public struct MyStruct{


   public string attr1;

   public string attr2;


 }//end MyStruct

}


I don't understand why there is a duplicate. Could this be something wrong with the code generation templates?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: duplicate code from forward engineering
« Reply #2 on: April 06, 2005, 11:29:13 pm »
It's not a problem with the code templates and is a bit different from what you said.

Currently inner classes aren't being recognised for synchronisation.

This should be fixed for build 751.

Simon