Instead of a public virtual method, you have a public method that calls a protected virtual method. Something like that:
public class Test {
public void DoStuff(){
ProtectedDoStuff();
}
protected virtual void ProtectedDoStuff(){
}
}
Instead:
public class Test {
public virtual void DoStuff(){
}
}
public class Test2 : Test {
public override void DoStuff(){
}
}
This avoids the re-implementation of all functions from the public method, if needed all the time. I know this has already been asked in stackoverflow, but I cannot find the question.
source
share