Book a Demo

Author Topic: importing C++ creates class duplicates  (Read 3168 times)

scott

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
importing C++ creates class duplicates
« on: October 29, 2002, 03:31:21 pm »
What are the conditions under which code import will
create a new class rather than
update (add attributes and operations to)
an existing class?

I have an existing model, created partially from scratch
and partially by code import.
I work on the model, and I work on the source code,
but I haven't been generating code from the model
(mostly because of old biases and bad experiences with
competing products).

There comes a point at which the model and the source code
have diverged too far, so I try to synchronize the model
with the source code using Import Source Directory.

Some classes are updated correctly,
but others are not updated and new classes
with identical names are imported instead.
What are the rules to be followed here?

Thanks for any assistance...

Regards,

Tjerk

  • EA User
  • **
  • Posts: 231
  • Karma: +1/-0
    • View Profile
Re: importing C++ creates class duplicates
« Reply #1 on: October 30, 2002, 02:14:17 am »
Hi Scott,

I don't really know what the rules are when you import a directory, but...

You might wanna try to import individual classes. I guess the classes are shown on a diagram. If so, open that diagram and be sure that the "code generation" toolbar is visible. Then, select the class that you want to reverse engineer and press the "Generate sourcecode" (2nd) button. This will open a dialogbox that shows the path and filename that is used to forward / reverse engineer the class. If there is no filename or the wrong one, then press the box on the right of the filename ("...") to select the proper filename. If you get a question if EA may override the file, don't panic it will not override that file unless you select forward engineer (generate).

So now that the proper file has been selected, you can rightclick on the class in the diagram and select code generation / reverse engineer to update your class.

This can also be done for a class that is not yet in the model, but has allready been implemented. Just follow the same procedure.

Greetings,
Tjerk

Ps. Geoff, it might me nice to have the code generation options improved (e.g. remove the "override" warning) and at least have them shown when rightclicking a class in the project browser.