Spring Boot Kotlin - Architecture
This chapter will explain you about Architecture on Spring Boot.
Spring Boot Architecture
Before you can learn more about Spring Boot, you should first understand the Architecture of Spring Boot, which has the following four:
Presentation Layer: A layer that handles HTTP Requests, translates the JSON Parameter into an object, verifies the request, and then passes it on to the business layer.
Business Layer: a layer that handles all business logic
Persistence Layer: A layer that handles all storage logic and converts business objects into database rows.
Database Layer: A layer that handles CRUD Operations
Spring Boot Flow Architecture
The image above represents the Basic Flow Architecture
for Project Spring Boot:
- Model: has the role of creating a
table
and communicates with thedatabase
. - Repository: has the role of generating data, modifying data, deleting data, and displaying data from the Database, and it interacts with the
Model
. - Service: has the role of creating
business logic
for the program and it interacts withRepository
and to be able to use theRepository
in theService
you need to inject the dependency of the repository. - Controller: has the role of creating an
http request endpoint
for theclient
torequest
what the client wants, such as creating data, modifying data, deleting data, and displaying data, and it interacts withService
and to be able to useService
in theController
you need to inject the dependency of the service. - Client: the
client side
that is responsible for requesting to theController
endpoint.
Summary
- After studying this chapter, you will be able to understand more about Spring Boot Architecture.