Book a Demo

Author Topic: Showing/using inherited operations (C++)  (Read 5106 times)

AdamHearn

  • EA User
  • **
  • Posts: 58
  • Karma: +0/-0
    • View Profile
Showing/using inherited operations (C++)
« on: August 08, 2002, 03:46:13 am »
Draw interface IBase, add a couple of operations.
Draw class CBase and draw a realisation link back to IBase.
Visually, the CBase class does not then show the inherited methods. Is this possible ???

Additionally, code generation for IBase: the header doesn't include any of the operations - FIXED by latest version!
Further to that, if I derive another class (CDerived) from CBase, no methods are created when code generating for CDerived. CBase has the two interface methods as virtual so I'd have expected CDerived to follow suit.

I think what's needed is something like:
In the operations list, all methods from the inhertance tree should be shown (optional if you want by class/diagram setting) which list the operations inherited by the class from the specified base 'classes'. A checkbox next to each can be used to say that implementation of the method is provided within the scope of the class being implemented. Additionally, a change to the operation type (virtual to concrete) should also be possible? The diagram should also show those methods implemented in the diagram operations list.

Does this sound reasonable or have I missed something fundamental and EA already does what I need ???

I've uploaded a copy of the EA project in case the above is not clear!

Edit: The EA project to download is here
Edit2: Grabbed latest build as 498 had broken Abstract/Pure checkboxes and fixed another of my problems.

Thanks in advance, Adam
« Last Edit: August 08, 2002, 04:15:06 am by AdamHearn »

AdamHearn

  • EA User
  • **
  • Posts: 58
  • Karma: +0/-0
    • View Profile
Re: Showing/using inherited operations (C++)
« Reply #1 on: August 12, 2002, 08:51:49 am »
Is anyone able to respond?

Thanks in advance, Adam

Duc-bert

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Showing/using inherited operations (C++)
« Reply #2 on: August 13, 2002, 11:57:55 am »
Hi,

in the derived class, if you decide to provide the implementation of a pure/non-pure virtual method then sure you need to redeclare it; otherwise you don't ( visually, or generated code ). So, I think EA is OK in this case. I play with round trip engineer and EA still has problems so be very careful when you synchronise your model with code. I also like to see EA provides a correct way to specify "&" and "*"; currently, you can only specify "by reference" or "by value" and "by reference" you can only choose "&" or "*". In C++, they are different.

:)
D.

Peter Jones

  • Guest
Re: Showing/using inherited operations (C++)
« Reply #3 on: August 27, 2002, 11:30:58 am »
This sound extremely reasonable and just exactly why I search the discussion forum.  It is simply common sense and basic to OO Programming.  I see no reason why I would declare a method as virtual making the class abstract then go through the trouble of defining a derived class and then NOT adding the required definition and implementation to this derived class.  

I agree that this should be added ASAP so that I can use the product. :o