Skip to content

RND-38: implement initial Spring Boot project with 3 layered architecture#9

Open
andrii-topoliuk wants to merge 1 commit into
masterfrom
andriit/RND_38_initial_spring_boot_project_example
Open

RND-38: implement initial Spring Boot project with 3 layered architecture#9
andrii-topoliuk wants to merge 1 commit into
masterfrom
andriit/RND_38_initial_spring_boot_project_example

Conversation

@andrii-topoliuk

Copy link
Copy Markdown

Implementing an example of 3 Layered Architecture using Spring Boot 3.
The application golden-example consists of next sub-modules:

  • controller
  • model
  • service
  • repository
  • exe

On the other hand service and repository modules also contain an api and impl submodules.

In the api modules, we have only interfaces defined for importing into the higher modules (like service-api module was imported into the controller module) which allows us to restring access from higher modules to actual implementation forcing them to use interfaces instead.

This structure allows us dynamically switch the implementation of some specific modules without changing higher modules.
In this project, we can easily change between different implementations of the repository layer which allow us to migrate, for example from using MySQL DB and JPA implementation to Postgres DB and JOOQ implementation by just changing the profile from mysql-jpa-repository to postgres-jooq-repository in application.yaml or with the appropriate property during startup.

The project also contains docker folder with docker-compose.yaml file for easily spinning up DBs locally for testing.

For starting the application we have exe module which contains all submodules from the application for adding them to jar and context.

@andrii-topoliuk andrii-topoliuk force-pushed the andriit/RND_38_initial_spring_boot_project_example branch from 3f99287 to e8fe0a8 Compare April 20, 2023 10:39
@sonarqubecloud

Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 2 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant