public abstract class FooBase {
protected FooBase() {
}
public void DoSomething(int x, int y, string s, bool b) {
DoSomethingImpl(x, y, s, b);
}
public void DoSomething(int x, int y, string s) {
DoSomethingImpl(x, y, s, false);
}
public void DoSomething(int x, int y) {
DoSomethingImpl(x, y, null, false);
}
protected abstract void DoSomethingImpl(int x, int y, string s, bool b);
}
public class Foo : FooBase {
protected override void DoSomethingImpl(int x, int y, string s, bool b) {
//do parameter checking here..
if (b) ...
if (s == null) ...
}
}