3 ms·
This is one of those things that I wish type systems could just do for us. The pattern of every single class in Java being an an interface with an InterfaceImpl
by Spivak 6y ago
This is one of those things that I wish type systems could just do for us. The pattern of every single class in Java being an an interface with an InterfaceImpl is exhausting.
Having to fight the type system just for testing seems silly. Just have every class's public bits define an interface and the class's name in code always refer to the interface.
Then testers can just implement ClassName with no fanfare and you stop having to write "test-friendly" classes.