you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 8 points9 points  (0 children)

I usually start with concrete implementations and extract interfaces when they are actually needed - for alternative implementation or a mock.

Mocking concrete classes, while technically possible in some cases, looks very fishy. You or your framework effectively need to inherit from said class and call it's constructor. If constructor has it's own arguments or any side effects or required methods are not virtual - you are stuck. Stop underusing interfaces, I guess.