Author Topic: Feature request: propagate method to subclasses  (Read 3583 times)

GeorgeS

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Feature request: propagate method to subclasses
« on: March 25, 2008, 01:48:45 am »
(I don't see how to do this without Automation programming, but it seems like a no-brainer feature...)

When I add an abstract method to an interface or class, it must eventually have implementations in inheriting classes. I'd really like to be able to pick one or more such methods (in the abstract class), then obtain a list of inheriting/realizing classes and ensure that they contain concrete implementations/overrides of these methods. I can do this on a subclass-by-subclass basis through Cntrl-Shift-O, and I get the option once when I first establish the realizes/gen-spec relationship, but thereafter it all seems very disconnected. Similarly, if the abstract signature changes, I need to propagate changes to subclasses. But it seems that EA does not know that a method in a subclass is actually an override of a method in a base, so when the base changes the subclass's must change.

If I am missing knowledge of a function already present, please let me know (I know about Shift-Ctrl-O, it just works in the wrong direction). If someone has solved this in Automation already, please respond.

Thank you-
George Spofford


«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Feature request: propagate method to subclasse
« Reply #1 on: March 25, 2008, 02:16:15 pm »
Don't know George, since I've never run up against testing this. But I have not noticed this in the documentation - again, that does not mean it's not there.

This would certainly be an excellent feature (or feature request). Perhaps you should send it in to Sparx - see the link near the bottom of the page.

I suspect this could be checked by the EA 'engine' without too much difficulty.

David
No, you can't have it!

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Feature request: propagate method to subclasse
« Reply #2 on: March 25, 2008, 06:54:07 pm »
I fully agree with this as a (very!) useful feature.

I can also add that if you look at the inheriting class, the method which you have overridden has a couple of tagged values "Implements" and "ImplementsGuid", which contain the name and GUID of the inherited method. So the reference is still there, it's not a once-off copy. In other words EA does know that the method is an override.

If you're doing substantial changes to an interface and if you're working in anything larger than a toy model, you don't want a pop-up asking you if you want to propagate changes for each change you make (as indeed you did not suggest).
But it'd be a huge time (=money) saver to be able to do it on request. After all, initial design is a small percentage of the work. The bulk of the time is spent on refinement and maintenance.

Also, why not include this as a model validation option? Any method which is actually an override / implementation of a method in another interface / class, and whose signature does not match that of the inherited method, gets flagged.
My theories are always correct, just apply them to the right reality.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Feature request: propagate method to subclasse
« Reply #3 on: March 25, 2008, 11:43:45 pm »
Perhaps even an option to validate when you actually create an override or shadow. It could be as simple as a drop-down (or something) that tells you what's there. Or a warning dialog if nothing matches; of course there would also be an EA-level option to silence this warning, similar to embedded white space in class names.

And the obvious case: propagate name changes downwards (from the ancestor class to descendants). This is part of the signature or course, but it bears explicit mention, since 'motherhood' situations are often overlooked.

David
No, you can't have it!