I’m attempting to leverage better separation of our modules on a legacy project. Before I get too deep into this, I want to ensure that this is still the generally accepted way to handle Hibernate DAOs.
We are utilizing Spring MVC, as I understand it the practice is to inject our services into the controllers, and the DAOs into the services which rely upon them.
I saw this question: JPA & Hibernate Best Practices, but it was asked quite some time ago. Is this still the typical way to layer Java EE projects or has a new methodology been born?
Yes, it is the typical approach. And it works fine.
It’s not necessarily the best one, as many domain-driven design advocates will advise you, but that’s a longer discussion (where to inject repositories (daos)). So for now – stick with your approach.