3 ms·
If you are rigorous as to make classes final, you should also be rigorous to never provide a non-interface as an Application Programming Interface. Google uses
by lupire 2y ago
If you are rigorous as to make classes final, you should also be rigorous to never provide a non-interface as an Application Programming Interface.
Google uses mocks and fakes implementations of interfaces, and provides dependency injection frameworks for managing these (Guice and Dagger).
- stickfigure 2y agoI once worked with a guy who obsessively made interfaces for every java class. Even domain objects. He was extremely proud of this. It was garbage.
- redditor98654 2y agoWas this in Amazon? If so, it might have been me. Sorry about that. I have learnt my lesson now. I don’t recall doing it for domain objects though.