Recently I began working on a largish mainstream project to deliver a public-facing e-commerce platform for a client I cannot reveal.
I'm working with seasoned developers with many years experience across many projects in the City of London.
It seems everyone is into interfaces in a big way. It's overwhelming and I now doubt everything I've done before, which is to use abstract base classes.
.NET is not COM, it's not an interface-based programming platform. Am I missing something or is this just herd mentality - the years of IProgramming have proliferated as accepted norms in .NET land?
Thanks
Luke
Interfaces promote loose coupling, and are easy to mock. They make the separation between API and implementation very clear.
Of course, you can use abstract base classes when there'll be common functionality between different implementations (and there can still be an interface on top of the abstract class if you want) but if everything in the abstract class is abstract, and there are no fields, why use up your one shot at inheritance by way of an abstract class? Where's the benefit?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With