force property implementation on derived classes
That's what abstract
is for:
public abstract class Person
{
public enum ExperienceLevel { Kid, Teenager}
public abstract ExperienceLevel Experience { get; set; }
}
If you want to force derived classes to implement the property themselves while at the same time providing some reusable scaffolding to help them, expose the scaffolding as protected
members inside Person
.