Interface or abstract class?

Generally speaking, the approach I use in this kind of situation is to have both an interface and an abstract class. The interfaces defines, well, the interface. The abstract class is merely a helper.

You really can’t go wrong with this approach. Interfaces give you the flexibility to change implementation. Abstract classes give you boilerplate and helper code that you aren’t forced to use, which you otherwise would be if your methods were defined in terms of an abstract class explicitly.

Leave a Comment