3 ms·
I agree fully from a purists PoV: pure OO means I get to redefine anything I want when I inherit, a la Smalltalk. In practice though I like to think that the r
by bonesss 9y ago
I agree fully from a purists PoV: pure OO means I get to redefine anything I want when I inherit, a la Smalltalk.
In practice though I like to think that the re-use of my objects and class hierarchies is a critical part of their design. Just about anything I'm gonna have to override to make a simple mock will also be an issue for other implementers. So why not use the opportunity to abstract and refine the objects internal logic to make mocking the relevant functionality cleaner and more obvious? Create an internal "OnProcessComplete" method which can be overridden easily instead of mocking the whole "Process" command.
Over-mocking is a major code smell and productivity thief. I find that having to manually set it up keeps me honest about cost/benefit, while also looking at an important design aspect that otherwise could be ignored.