Found in 1 comment on Hacker News
meaty · 2013-02-26 · Original thread
Firstly the interface isn't a layer of abstraction - it's a contract, a boundary. An abstraction is an arbitrary concept which may or may not apply to an interface.

Secondly, the abstract base concept is actually a deadly form of coupling. As many people have suggested since the dawn of the problem, composition is better than inheritance and what sits at the composition boundaries? Interfaces! Inheritance usually turns into an LSP-violating [1] clusterfuck. I know - I have spent 2 weeks refactoring one into something which doesn't stick a fork in your eye every time you change something. And this is a non trivial one with over 100 classes in the inheritance graph (this is a roughly vomited out version of the Party archetype from the MDA book [2]).

So your tests are chock full of empty stub classes rather than mocks? Yuck.

If you look at ASP.Net's native API (before System.Web.Abstractions hid all the crimes away), you will see the sort of shit you'll get yourself into if you follow your own advice.

Agree with your last point though.

For reference, yes I am an architecture astronaut with one foot nailed to the ground :)

[1] http://en.wikipedia.org/wiki/Liskov_substitution_principle

[2] http://www.amazon.com/Enterprise-Patterns-MDA-Building-Arche...

Fresh book recommendations delivered straight to your inbox every Thursday.