Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrii-topoliuk
Copy link

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

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