Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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).



I 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.


Was 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: