Abstract operations are not overridden by operations in derived template specialization classes
|Status:||New||Start date:||22 August 2020|
I think the screenshot shows everything. There is a chain of abstract classes which have templates. At the end of the chain is a template class with several specializations. One or more of the abstract methods defined in the base classes are not implemented except in the specialized classes.
However, Modelio gives me an error when I try to do this: “R2340 – A redefined Operation must belong to a parent or an implemented Interface of the owner of the Operation.”
The specialization, or binding class, does not inherit from the template class. But it is perfectly legal in C++ to do this; I don’t know why it causes problems with UML.
#2 Updated by Robert Hairgrove 2 months ago
- File modelio_error2.png added
Actually, this description was not completely like the problem I am having. The new screenshot illustrates this much better.
In a nutshell, the template specializations remain abstract because op1() and op2() are only implemented in the classes which derive from the specializations. This must be a rather common idiom in C++.
I was able to work around the problem by creating additional generalization links between the template specialization classes and the template classes they specialize, then hide them in the diagram. At least it makes the errors go away. Since I am not interested here so much in code generation, I can live with it (the code exists already; I am trying to construct a UML model for documentation purposes).