What is the word or phrase you'd use to describe an inheritance relationship where subclasses are expected to call base class methods they override?
-
Example - a test class hierarchy where Subclass::Setup() is expected to call Base::Setup()
-
Answer:
There is no name for it because this is an error prone pattern that should be avoided. A more correct implementation would be : Abstract Base class : public: virtual void test(){ // common setup this->abstractTest(); } protected: virtual abstract void abstractTest(); The subclass must implement the abstractTest method and the class is tested by calling the test method.
Koen Samyn at Quora Visit the source
Other answers
I would just call it something like "calling the superclass implementation"
Xuan Luo
An example is how the assignment operator of a derived class is implemented: Derived& Derived::operator=(const Derived& rhs) { // check for self-assignment. ... Base::operator=(rhs); // call this->Base::operator= ... } See also http://www.parashift.com/c++-faq-lite/assignment-operators.html#faq-12.4 .
William Wong
Related Q & A:
- What is your favorite catch phrase?Best solution by Yahoo! Answers
- What does the word psych mean to you?Best solution by Yahoo! Answers
- What's the word "pinch" in Korean?Best solution by Yahoo! Answers
- What can you do with a Ph.D in computer science?Best solution by scienceforums.net
- What does the word "Pity" mean?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.