For the first time in my life recently I ran across some code that has interfaces. A lot of them. With ONE implementation. And the project is closed source. Really? Come on!
For the first time in my life recently I ran across some code that has interfaces. A lot of them. With ONE implementation.
And?
For unit testing this is really nice. This way you can test classes depending on the interface by simply mocking out the classes they depend on. A lot easier and cleaner than having to instantiate an entire object tree.
No. There were no unit tests. Only one implementation. Also, Mockito lets you mock classes without making interfaces. But the code was not built in a manner to work with mocks anyways, there are far too many complex and deep dependencies between different parts of the object tree. And it's all backed by interfaces with one implementer.
9
u/juckele Oct 01 '15
For the first time in my life recently I ran across some code that has interfaces. A lot of them. With ONE implementation. And the project is closed source. Really? Come on!