Sparx Systems Forum
Enterprise Architect => Suggestions and Requests => Topic started by: GeorgeS 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
-
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
-
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.
-
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