DEV Community

Discussion on: How do you choose between an interface and abstract class?

Collapse
 
ghost profile image
Ghost

I'd generally recommend interfaces if you want to publish your codebase as library, as your users are not forced to abide your inheritance.

In this scenario, it's advisable to publish an interface and provide a default implememtation (similar to IEnumerable and everything in System.Collections)