Interface Best Practice

implementation, interface, java

Solution

Not bad practice at all - I'd expect almost any non-trivial concrete implementation class to contain private methods. The alternative would often be to have much too large method bodies within the class.

Don't forget, no-one outside the class should care at all whether you've got lots of private methods or not. They should only care about your public API (or your package / protected API where relevant).

Problem

Probably a general question, but it is considered a bad practice to have an interface (Service), and an implementation of it (ServiceImpl), but with ServiceImpl containing private utility methods that are not contained in the interface?

Original source