Not for me, it didn't.
When I selected the the pure virtual operation in the Overrides & Implementations dialog, it gave me a pure virtual operation in the child. (As, in my view, it should - I'm the one who decides how I'm going to implement or override the child operation - NOT EA).
Since the observed behaviour appears different in our two universes, the rest of your post is moot.
Can you identify the version you're using and the process you went through to get the outcome you observed?
Then we might be able to zero in on how to help you.
Paolo
Hi Paolo,
I agree with you that the best behavior in general terms would be for EA to not change the qualifiers at all. However, when I choose to override a function in an inherited class, why would I do so without wanting to provide an implementation? Or in other words: why should the
Pure attribute stay?
Anyway, that is not what I get either way. What I do is the following:
1. In a class diagram, create a new class
Class1 and an operation within that class,
myfunc. The attributes for this operation are:
Abstract and
Pure. I can generate this class as C++ and what I get is this:
class Class1
{
public:
Class1();
virtual ~Class1();
virtual void myfunc() =0;
};
This looks good.
2. I create another class in the same diagram,
Class2.
3. Using the
Class2 quicklink, I draw a Generalization link to
Class1. This opens the
Override & Implementation dialog for me, presenting the function
Class1::myfunc(). I select that function and close the dialog. When I look at the attributes of the newly generated function
Class2::myfunc(), I see that now only the
Pure attribute is selected. When I generate code out of this I get the following:
#include "Class1.h"
class Class2 : public Class1
{
public:
Class2();
virtual ~Class2();
void myfunc() =0;
};
This is bad!
4. I can do the same by using the
Class1 quicklink, creating a new class
Class3 as a Specialization of
Class1. When I do that I get the same code as above for
Class2.
I am quite sure I used this feature (the Override & Implementation dialog) before, but wasn't aware of any problems so far, so I strongly suspect I inadvertantly changed a setting that I shouldn't. I can't for the life of me think of what that might have been however...
