When should I use an interface and when should I use a base class?

Technology CommunityCategory: OOPWhen should I use an interface and when should I use a base class?
VietMX Staff asked 3 years ago

Modern style is to define IPet and PetBase. The advantage of the interface is that other code can use it without any ties whatsoever to other executable code. Completely “clean.” Also interfaces can be mixed. But base classes are useful for simple implementations and common utilities. So provide an abstract base class as well to save time and code.