Re: how to: extract interface of class with methods from a superclass

Michal Svoboda <[email protected]> Sat, 21 Sep 2013 19:05:23 +0200
Newsgroups gmane.comp.programming.refactoring
Message-ID <[email protected]>
Donaldson, John wrote:
> Well, yes - any user of B sees A's methods. But when you "extract
> interface" you are doing to get the interface to that class - not its
> supertypes.


I don't get how is that possible ... you say your class C calls method
on B thus ... "myB.MethodOfA"


So MethodOfA *must* be in (public) interface of B in order to be
callable like that... maybe a concrete example could clear this up?


Anyways, if inheritance gives you trouble you can always go and do
a "replace inheritance with delegation".




Michal