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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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).