Giter Club home page Giter Club logo

clean-architecture-demo's Introduction

Compile and run the app

./mvnw install && ./mvnw spring-boot:run -pl application

or

./mvnw install && java -jar application/target/application-1.0.0-SNAPSHOT.jar

Description of the architecture

The project consists of 4 modules adapter, usecases, domain, and application.

domain module

This module contains the domain entities. There are no dependencies to frameworks and/or libraries.

usecases module

This module contains the business rules that are essential for our application (Application business rules). The only dependency of this module is to domain. In this module, gateways for the repositories are being defined. Each use case defines the interface of the gateway that is required following the ISP. These gateways, operate on the domain entities defined in domain.

adapter module

This module contains the implementation of the gateways defined in the usecases module. This module depends on the framework that facilitates the data access. In our example, we use JPA and Spring Data. The Jpa*Repository classes are the actual implementation of the gateways defined in the usecases module.

These repositories, use the Spring Data JpaRepository as dependencies. The entities in this module, are JPA entities, so mappings to and from these and the domain entities are needed.

application module

This module contains all the details of the delivery mechanism that we use along with the wiring of the app and the configurations. In our example, we use rest services built with Spring Boot. Similarly, to the JPA entities of the adapter module, the DTOs have mappers, to convert from and to the domain entities.

clean-architecture-demo's People

Contributors

mathmach avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.