Suppose that class A inherits from class B which in turn inherits from class C. Now suppose that a virtual method void f() has been defined in A, which is overridden in both B and C. Calling B.f() from any method in A can be done by simply using base.f(). What about calling C.f() from a method in A?
Share
Generally, by overriding a class, you are accepting that it provides the interface and some of the behavior you want. A shouldn’t know about it’s super-superclass unless explicitly exposed in some way by its superclass. This is actually desirable, because you don’t need to know how C is implemented when you subclass B. You shouldn’t even know that C is involved.
If b’s f() calls base.f(), a’s base.f() just needs to call its own base.f() and you’re done. If it doesn’t, the only way to do that yourself is through intrusive methods based on Reflection. If you find yourself needing to do this, you’ve probably got an error in your design (violating the Law of Demeter, for one).