Book a Demo

Author Topic: Problem with realization link and code generation  (Read 4754 times)

helpme3

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Problem with realization link and code generation
« on: September 03, 2008, 09:16:49 pm »
Hi all,

i`m having a problem with the automatic code generation of EA.
Im working on a class diagram.
In there i create an interface named TestInterface with one Method, named TestMethod, in it. Next i create a class named TestClass and a realisation link between the class and the interface.
Finally i select all Methods - only one in the example - to be overriden/implemented by the class.

The next step is to create C# Code out of this class diagram and i get the following code for the class
Code: [Select]
public class TestClass {
      public void TestMethod(){
      }
}

Where is the Interface? I expected something like
Code: [Select]
public class TestClass : TestInterface
{
...
Are there any additional options that must be set to achieve this?
Btw. as an ugly workaround i can select the TestClass and set a generalisation link between the TestClass and TestInterface. But this isn't correct in my UML understanding.  If i do a reverse engineering on the expected result I also get a realisation link. Unfortunately the next time i synchronize the model with the code the interface implementation is again gone.
So is it a bug or just wrong usage of EA?

Thx
« Last Edit: September 03, 2008, 09:54:56 pm by helpme3 »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Problem with realisation and code generation
« Reply #1 on: September 03, 2008, 09:34:12 pm »
Make sure you define a realization link between the class and the interface. EA will see this at code generation time and issue the necessary code for the class to realize the interface, as you desire.
No, you can't have it!

helpme3

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Problem with realisation and code generation
« Reply #2 on: September 03, 2008, 09:52:49 pm »
I've already made a realization link between the class and the interface and I do not get the interface in the source code! This is my problem!!!
Is it possible that this is a config parameter i've set without knowing it or anything else?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Problem with realization link and code generat
« Reply #3 on: September 03, 2008, 09:59:41 pm »
Look in the EA help index for Realized Interfaces | For Class, Show on Diagram.

Try this and see if you get the results depicted in the EA help. If not, something is not right.
No, you can't have it!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Problem with realization link and code generat
« Reply #4 on: September 03, 2008, 10:03:21 pm »
What happens if you just import your code - build by hand with the correct syntax - into EA? I mean as a clean, new package. How does EA set up the interface then?
No, you can't have it!

helpme3

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Problem with realization link and code generat
« Reply #5 on: September 03, 2008, 10:24:07 pm »
Well really strange things happened here.
I just downloaded the demo and installed it in a clean Virtual Machine.
In it everything works as expected.
Now two things come to my mind.
1. The registered installation version is 7.1.831 and the demo is 7.1.832 could this be the problem? Unfortunately I have to trigger the download of the new version by my team manager which will last a few days ...

2. Something is misconfigured in my "true" system. Is there a way to do a "factory reset" of EA?

thanks a lot for your responses

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Problem with realization link and code generat
« Reply #6 on: September 03, 2008, 11:34:48 pm »
I doubt (without proof) that it is the first problem. EA has done things this way for a long time.

As to the second, one solution would be to delete your registry tree for EA. It will create a new tree the next time you start up, and will reset the values. [Make sure you have saved your product key first; I don't know if it is saved in the registry in some form.]

There's a slim possibility that this has something to do with the EABase project that's supplied with each full build - I don't think it is normally replaced by the patches, but this might happen for some builds. You could always make copies of the EABase project from different EA builds and try them out.

David
No, you can't have it!

helpme3

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Problem with realization link and code generat
« Reply #7 on: September 04, 2008, 01:32:14 am »
The deletion of the registry values hasn't helped. Still the same behaviour after starting EA.
The strange thing is, that i can take the eap file from the corporate edition and load it in the demo version and everything works as exspected.
Well i think i have to wait till i can try the .832 Corporate Version.

Best regards

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Problem with realization link and code generat
« Reply #8 on: September 04, 2008, 03:48:54 am »
Interesting behavior.

I think this is worth sending a bug report to Sparx. Look near the bottom of any forum page for a link. Paste in a link to this forum thread.

David
No, you can't have it!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Problem with realization link and code generat
« Reply #9 on: September 04, 2008, 09:15:09 am »
Build 831 had a problem related to realizations etc. in code engineering.  Build 832 still has a related problem for associations.  We are aware of both issues and aim to correct the association problem with the next build.
« Last Edit: September 04, 2008, 09:15:54 am by simonm »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Problem with realization link and code generat
« Reply #10 on: September 04, 2008, 09:45:04 pm »
Thanks Simon,

At least we're not alone on this one.
No, you can't have it!