Skip to main content

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

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 the database.
  • 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 with Repository and to be able to use the Repository in the Service you need to inject the dependency of the repository.
  • Controller: has the role of creating an http request endpoint for the client to request what the client wants, such as creating data, modifying data, deleting data, and displaying data, and it interacts with Service and to be able to use Service in the Controller you need to inject the dependency of the service.
  • Client: the client side that is responsible for requesting to the Controller endpoint.

Summary

  • After studying this chapter, you will be able to understand more about Spring Boot Architecture.