GithubHelp home page GithubHelp logo

bellmit / ddd-to-the-code-workshop-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cstettler/ddd-to-the-code-workshop-sample

0.0 0.0 0.0 389 KB

Sample project for "DDD to the Code" workshop

License: Apache License 2.0

Java 94.09% CSS 0.08% HTML 5.83%

ddd-to-the-code-workshop-sample's Introduction

DDD-To-The-Code Workshop: Sample Code

Sample project for "DDD to the Code" workshop.

Disclaimer

โš ๏ธ please do not practice Cargo Cult - when using this sample code in your projects, make sure you understand that code, and know why you are using it.

This sample project is for educational purposes only. It does not contain production-ready code. Specifically, the following aspects are not considered real-world like:

  • shared code in 'ddd-to-the-code-workshop-support'
  • in-memory database for persistence of aggregates
  • prototypical domain event infrastructure implementation (non-durable subscriptions, no dead letter handling, ...)
  • low test coverage in accounting and rental bounded contexts
  • no handling of dependencies between domain events (e.g. in case booking is ended and should be billed based on the 'booking completed' domain event before the wallet has been initialized based on the 'user registration completed' domain event - currently, handling the 'booking completed' domain event would fail, the domain event would be redelivered and eventually moved to dead letter queue)

... and a lot more

Overview

Bounded Contexts and Use Cases

Use Cases

  • register new user
  • initialize wallet for user with welcome amount
  • book and return bike
  • bill booking fee on wallet

Demo

Use the following script to walk through the implemented use cases:

Preparation

Note: due to compatibility issues with AspectJ and Java 11, this project has to be compiled and executed using Java 8.

  • build project:
    ./mvnw clean package
  • start registration bounded context:
    java -jar ddd-to-the-code-workshop-registration/target/ddd-to-the-code-workshop-registration-0.0.1-SNAPSHOT.jar
  • start rental bounded context:
    java -jar ddd-to-the-code-workshop-rental/target/ddd-to-the-code-workshop-rental-0.0.1-SNAPSHOT.jar
  • start accounting bounded context:
    java -jar ddd-to-the-code-workshop-accounting/target/ddd-to-the-code-workshop-accounting-0.0.1-SNAPSHOT.jar

Initial State

Register New User

  • start user registration (http://localhost:8081/user-registration/)
  • enter user handle (e.g. "peter")
  • click "Next >" button
  • read verification code from console of registration bounded context (6 digits code)
  • enter verification code
  • click "Next >" button
  • enter first and last name (e.g. "Peter" and "Meier")
  • click "Complete" button
  • check for new wallet (http://localhost:8082/accounting/wallets) with initial amount

Book Bike

Return Bike

ddd-to-the-code-workshop-sample's People

Contributors

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