Code Monkey home page Code Monkey logo

ddd-strategic-design-spring-boot's Introduction

DDD Strategic Design with Spring Boot

Application to demonstrate Domain Driven Design Context Mapping patterns based on variosu Spring Boot applications. Please bear in mind that the application itself is kept simplistic, in order to isolate the focus on the Context Mapping Patterns. This is the reason why you will find some logic in Controllers that should be placed in other classes in a real-world application or the reason why I use database IDs for a general purpose.

Also keep in mind that some of the Context Mapping Patterns not best practices but are things that are found in existing, historically grown applications. Context Mapping is mostly a way to look at existing solutions and this code example is an existing solution that has some intentionally built in issues.

A good starting point for your analysis is the CreditApplicationController in credit-application as it implements the main workflow.

Prerequisites

  • You need a current version of Maven
  • A basic installation of Redis must be installed and running (redis-server)

How to run and install the example

There is no "one-stop" build and install script as of yet so you will have to take a few easy manual steps that you should run in this specific order:

  1. Start your redis-server
  2. Build the scoring-shared-kernel module
  3. Build the customer application
  4. Run the customer application
  5. Run mvn jaxb2:generate in credit-application while the customer application is running
  6. Run the scoring application
  7. Run the credit-agency application
  8. Run the customer-contact application
  9. Run the credit-application application
  10. Start entering data at http://localhost:9090

URLs and Ports

Each of the modules is it's own Spring Boot Application which can be accessed as follows:

Name Application / Enpoint Type Port URL
Credit Application Web App 9090 http://localhost:9090/
Customer WSDL Endpoint 9091 http://localhost:9091/ws/ or http://localhost:9091/ws/customer.wsdl for the wsdl
Credit Agency REST Endpoint 9092 http://localhost:9092/personRating
Scoring RMI Endpoint 1199 http://localhost:1199/scoringService
Customer Contact No active server endpoint, listens to Redis on the following topics: customer-created-events, credit-application-approved-events No open port No available URL for access

ddd-strategic-design-spring-boot's People

Contributors

mploed avatar patrickcrocker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ddd-strategic-design-spring-boot's Issues

Division problems in performScoring

Certain values can lead to some BigDecimal division problems:

  • Term: 12
  • Amount: 500
  • Income: 50000
  • Rent: 650
  • Cost Of Living: 200

Results in this exception:

2017-04-12T10:44:49.525-05:00 [APP/PROC/WEB/0] [OUT] 2017-04-12 15:44:49.525 ERROR 6 --- [nio-8080-exec-9] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.] with root cause
2017-04-12T10:44:49.526-05:00 [APP/PROC/WEB/0] [OUT] at java.math.BigDecimal.divide(BigDecimal.java:1690) ~[na:1.8.0_121]
2017-04-12T10:44:49.526-05:00 [APP/PROC/WEB/0] [OUT] java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.
2017-04-12T10:44:49.526-05:00 [APP/PROC/WEB/0] [OUT] at com.innoq.mploed.ddd.application.domain.CreditApplicationForm.getMonthlyPayment(CreditApplicationForm.java:75) ~[classes/:na]
...

404 not found: https://mploed-customer.cfapps.io/ws/customers.wsdl

Hello,

First of all, thank you for your slide on DDD>

I found your slide at https://speakerdeck.com/mploed/ddd-strategic-design-with-spring-boot-examples

I just tried to follow step by step on your README and encountered an error while building customer application.

[ERROR] Error while parsing schema(s).Location [].
com.sun.istack.SAXParseException2; IOException thrown when processing "https://mploed-customer.cfapps.io/ws/customers.wsdl". Exception: java.io.FileNotFoundException: https://mploed-customer.cfapps.io/ws/customers.wsdl.

it looks like the file is no longer there.

Is there a way to fix this?

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.