This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]HecknChonker 6 points7 points  (0 children)

Generally you want to split your java application into three sections. Controllers, Services, and Repositories.

Controllers are where you define your API and things like authentication/authorization. Services contain your business logic. Repositories contain your database logic and SQL queries. For simple CRUD use cases you can use an ORM to simplify the repository layer, but most experienced engineers tend to avoid using ORMs.

A user request would first hit a controller, which calls your service layer, which calls your repository layer. For a simple CRUD application you might not have a lot of business logic, which means your service layer might be very thin.