TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Designing via Interface in Java?

2 pointsby antoaravinthalmost 8 years ago
Hi, Often I see experienced Java developers asking us to develop the system using Interfaces rather than starting with classes. Yes, I do create interfaces, I know whats its usecases are etc. However the term &quot;design your system using interfaces&quot; is somewhat confusing to me. Is it a pattern for designing robust application in Java world? How should one learn it?<p>If so are there any online books &#x2F; blogs regarding the same?<p>Note: I had already asked the question in Java Subreddit, but I want to get HN community thoughts as well.

1 comment

davelnewtonalmost 8 years ago
I&#x27;m not clear on what the conceptual hurdle is.<p>Of course it&#x27;s a common pattern--that doesn&#x27;t mean it&#x27;s always necessary. It <i>does</i> make a lot of things easier, like testing, etc.<p>It&#x27;s the same thing as declaring your vars as `List` or `Collection` instead of `ArrayList`. If you do the same thing in your system you give yourself much more flexibility.