AlvaroMena
AlvaroMena

Reputation: 19

Spring boot - Data Access and Service Layer Implementation

I'm trying to implement the layers of a web application, so I wanted to ask you if you can suggest me a tutorial or any advice about how to design and build the Data Access Layer and the Service Layer

Upvotes: 1

Views: 3131

Answers (1)

Richard Yhip
Richard Yhip

Reputation: 106

The general way I have seen this structured in the traditional Java EE way is as follows:

  • Create entities that map to your database (or other source) tables
  • Develop your Data Access Objects (DAOs). Your DAOs are classes per entity typically that perform Create, Read, Update, and Delete operations on your entities.
  • Develop a service or facade layer. This allows you to perform more abstract business operations that your application uses. Your methods here may combine operations and data modification of your DAOs.

This is a nice tutorial that goes over a lot of my bullet points: https://www.javacodegeeks.com/2012/09/spring-dao-and-service-layer.html. It includes tests as well which are something you want to incorporate sooner rather than later in your development process.

Upvotes: 3

Related Questions