问题
Ok I'm new at my job, and now I'm assigned to a project which uses Spring, Hibernate and Wicket. And I see a lot of DAO and Services packages and I want to understand why they're used and what is advantajes of this.
I understand that DAO it's need for working with the databases, but I want more information.
I need an overall, a BIG PICTURE of DAO and Services layers.
回答1:
Take a look at Spring in Action. This book explains all essential aspects of Spring, DAOs and services.
回答2:
So the services are set up as the API to your application. Usually this is referred to as the service layer in a N-Tiered application. The Data Access Object layer is set up to provide business rules and access to the persistent data your application will store and access. The DAO's typically store the data in a database but can also persist it in other ways. Here are some suggestions for more details on this overview:
- Baeldung - Spring Persistence Tutorial
- JavaCodeGeeks - One Good Think
- Spring - Data Access with JDBC
- Stackoverflow question - Responsibilities and use of Service & Dao layers
来源:https://stackoverflow.com/questions/2026259/java-ee-where-could-i-read-about-dao-services-and-why-theyre-used