
controller
Handles user requests, calls the appropriate service methods, and returns the results.
service
The layer that processes business logic. It handles the requests received from the controller, manipulates data, and returns the results.
repository
The layer responsible for interacting with the database, performing CRUD (Create, Read, Update, Delete) operations.
domain
The package that defines the core domain model of the application. It includes classes related to database entities and their relationships.
templates
A package that contains view template files, usually including HTML, Thymeleaf, Freemarker, and other templates that are displayed to the user. In the Spring MVC pattern, this package is responsible for visually representing the data returned by the Controller.
Model: Saves and manages the data for the application.
View: Provides the visuals of the screen.
Controller: Recieves the HTTP request and sends the required data to the Model then draws the View as required.
💡 Indicated in the red box is the three layer architecture 💡
- Controller: Management of the REST interface to the business logic.
- Service: Business Logic implementations.
- Repository: Storage of the entity beans in the system.
