I have a class called 'Ship' and a class called 'Lifeboat'
Lifeboat inherits from Ship.
Ship contains a method called Validate() which is called before save and it has an abstract method called FurtherValidate() which it calls from Validate. The reason this is in place is so when you call validate on the base it also validates the class that is inheriting. So we have
public class Ship
public bool Validate()
{
//validate properties only found on a ship
FurtherValidate();
}
public abstract bool FurtherValidate();
So Lifeboat has
public override bool FurtherValidate()
{
//validate properties only found on a lifeboat
}
This means anyone implementing Ship also needs to provide there own validation for there class and it's guaranteed to be called on the save as the base ship.Validate() is called which in turns calls the inherited validate.
How can we re work this so we still force inherited classes to implement FurtherValidate() but FurtherValidate() can never be called by the programmer. Currently you can called Lifeboat.FurtherValidate and I want to somehow prevent this.
Thanks