Is an interface + extension methods (mixin) preferable to an abstract class?
If your answer is "it depends", what does it depend upon?
I see two possible advantages to the interface + extension approach.
- Interfaces are multiply inheritable and classes are not.
- You can use extension methods to extend interfaces in a non-breaking way. (Clients that implement your interface will gain your new base implementation but still be able to override it.)
I have not yet thought of a downside to this approach. There may be a glaringly simple reason that the interface + extension approach will fail.
Two helpful articles on this topic are