Coder Social home page Coder Social logo

ddd-eshop's Introduction

DDD-eshop

Description

Java, Spring Boot, JPA, H2

build

./gradlew clean build

Run Test

./gradlew clean test --info

Run

java -jar build/libs/homework-0.0.1-SNAPSHOT.jar

Architecture & Design Pattern & Test

  • The architecture follows the principles of Clean Architecture.
    • Application layer
      • Command
      • UseCase(adapter)
      • Service
    • Domain layer
      • Entity, VO
      • Event
      • Repository(interface)
    • Infrastructure layer
      • JPA Repository(persistence)

The main reason for applying Clean Architecture is to prevent changes in low-level modules (such as the UI) from propagating to high-level modules (core business logic). The Adapter Pattern reverses the direction of control between each module and removes dependencies, allowing each implementation to be injected through an external framework. This achieves low coupling and high cohesion, making it easier to write testable code.

Domain Design Pattern

Each Aggregate has been separated into three domains: Product, Cart, and Order. The Product domain is responsible for managing products and has the responsibility for quantity management.

The Cart domain is responsible for managing the products and quantities to be ordered before the actual ordering process. It plays a role in providing the order domain with the products and quantities the user wishes to order.

The Order domain is responsible for validating and creating orders based on the CartLineItems stored in the cart. It also handles the payment request to the payment service.

The sub-entities belonging to each Aggregate are accessible through the Aggregate Root, and domain rules are defined as much as possible within the domain entities to facilitate the management of core business requirements.

ddd-eshop's People

Contributors

coderhglee 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.