Skip to content

Comment on JVM Anatomy Quarksparent

Comments

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.