Book a Demo

Author Topic: Referring to classes in other packages  (Read 2603 times)

Johan_Johansson

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Referring to classes in other packages
« on: August 30, 2006, 08:42:28 am »
G'day

I have been using EA for two weeks now. I am modeling class diagrams and doing round-trip engineering in C++.

My models loose information every time i do a round trip and since EA seems to be a complete tool I believe there's a trick that I don't know about. It's when extending a class in another package; when I try and synchronize with the code the generalizations disappear.  :-/

I am writing a component that is going to be part of our framework. Because of this I try and keep these package trees seperate, even though they share part of the structure.

My class "OurFramework::Application::Control::MyClass" extends "OurFramework::Comms::Resource" but EA omits "OurFramework" from the generalized class, therefore it is not recognized when synchronizing and the link disappears.

thomaskilian

  • Guest
Re: Referring to classes in other packages
« Reply #1 on: August 30, 2006, 01:27:26 pm »
There's quite a lot discussion around round-tripping. In general you can not have all information synched and in some cases you need to to some hand work. I can't tell what exactly is going wrong (since I'm not a C** expert). But probably you should be a bit more detailed ??? since it is not clear to me which link you're talking of.

Johan_Johansson

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Referring to classes in other packages
« Reply #2 on: August 31, 2006, 01:57:08 am »
Basically, if I have the following generalization in my C++ code and in my model and I synchronize the model it is distorted; the inheritance link is removed.

Before the synchronization:

namespace OurFramework {
namespace Application {
namespace Control {

class MyClass : public OurFramework::Comms::Resource
{
  ...
} // end class

}}} // end namespaces

Model:

Comms::Resource  <3---------  MyClass

After the synchronization:

Code looks the same but the model has lost its link

Comms::Resource                    MyClass


Edit:

To me it seems as if the problem lies in how the overridden class is depicted in the model. If the class had its entire namespace as part of its class identifier I believe the model would recognize it (same namespace as in the code) and keep the link.
« Last Edit: August 31, 2006, 02:02:22 am by Johan_Johansson »