Book a Demo

Author Topic: Code Generation of the inherited features  (Read 3716 times)

Jsc

  • EA User
  • **
  • Posts: 23
  • Karma: +0/-0
    • View Profile
Code Generation of the inherited features
« on: January 11, 2020, 12:00:06 am »
Hello Everyone,

I have a question about the Code Generation of the inherited features.

I have drawn a parent class and a child class in EA and i have used Generalization to define this inheritance relationship.
Is it possible, use Macro to get the features of the inherited attributes and operations in the child class.

thanks a lot

jsc 

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code Generation of the inherited features
« Reply #1 on: January 13, 2020, 08:51:51 am »
The Set Feature Visibility dialog allows you to display inherited attributes and operations with the child on a diagram.

The Overrides and Implementations dialog allows you to explicitly create a copy of selected operations.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Code Generation of the inherited features
« Reply #2 on: January 13, 2020, 07:12:06 pm »
Hi Jsc,


It's been a while since I did code generation in EA, but I don't think there are any macros that refer to inherited attributes/operations.
Indeed, I don't see why there should be: those attributes/operations should be generated as part of the parent class, not the child class.

If you generate code for just the child class it won't compile, but you're supposed to generate code for both.
Or am I missing something? What is it you're trying to do?


/Uffe
My theories are always correct, just apply them to the right reality.

Jsc

  • EA User
  • **
  • Posts: 23
  • Karma: +0/-0
    • View Profile
Re: Code Generation of the inherited features
« Reply #3 on: January 13, 2020, 07:25:38 pm »
The Set Feature Visibility dialog allows you to display inherited attributes and operations with the child on a diagram.

The Overrides and Implementations dialog allows you to explicitly create a copy of selected operations.

Thank you Eve for your advise. The inherited attributes and operations are shown in the child class. But it seems like these element are abstract elements and i can not use list macro to generate.
« Last Edit: January 13, 2020, 07:32:30 pm by Jsc »

Jsc

  • EA User
  • **
  • Posts: 23
  • Karma: +0/-0
    • View Profile
Re: Code Generation of the inherited features
« Reply #4 on: January 13, 2020, 07:31:50 pm »
Hi Jsc,


It's been a while since I did code generation in EA, but I don't think there are any macros that refer to inherited attributes/operations.
Indeed, I don't see why there should be: those attributes/operations should be generated as part of the parent class, not the child class.

If you generate code for just the child class it won't compile, but you're supposed to generate code for both.
Or am I missing something? What is it you're trying to do?


/Uffe

Hi Uffe, thanks for your advise.
Yes, i am trying to write a code generation template for PLC. Actually i would like to realize this function: if i define a Generalization between a parent class and a child class,
by code generation of the child class the attributes und operations from the parent class can also be generated. But unfortunately i can not find a related macro in Code Template Framework. Thanks anyway :)

jsc