Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Process Automation with Domain-Driven Design @ ...

Process Automation with Domain-Driven Design @ Navigate 2021

In this talk I discuss the application of “strategic” and “tactical” patterns and best practices from domain-driven design to software projects for the automation of business processes - with or without the use of workflow engines. I will show that the two different worlds - “DDD” and “Workflow” - which appear to be very different and often look at each other with skepticism - have much more in common than not - but if and only if they are cleverly linked.

Martin Schimak

April 20, 2021
Tweet

More Decks by Martin Schimak

Other Decks in Programming

Transcript

  1. This is our automated process! Process starts! Make decision Check

    HUMAN REJECT! FRAUD_S ERVICE ANTI pattern
  2. After five sprints, it finally works! RAUD_S ERVICE Check GET

    invoice POST negative amount Process ends. REJECT! Yes No ANTI pattern
  3. 2004 2006 2008 2018 2010 2012 2014 2016 ? DDD

    … is not a book! It only started as a book. 2020
  4. 2) Strategic Design The three pillars of Domain-Driven Design 3)

    Modeling in Code 1) Collaborative Modeling 1) Collaborative Modeling
  5. Healthily obsess with language! Process starts! Make decision Check HUMAN

    REJECT! FRAUD_S ERVICE DDD Paradigm Invoice dispute raised Determine dispute handling strategy Economic relevance? Low: automatic handling Higher: manual handling Check invoice dispute Approved Approved Rejected Determine fraud potential Partially approved Partially rejected Dispute approved? Determine dispute handling strategy Check invoice dispute Determine fraud potential
  6. In DDD modeling is collaborative DDD emphasizes the importance of

    developing a shared mental model. DDD Paradigm
  7. Events (and more) on a timeline Something business relevant happened!

    Invoice dispute raised Invoice dispute approved Invoice dispute rejected Time
  8. Useful for process automation projects? Invoice dispute raised Invoice dispute

    approved Invoice dispute rejected Invoice dispute checked Yes! Time
  9. Useful for process automation projects? Invoice dispute raised Invoice dispute

    approved Invoice dispute rejected Invoice Check Fraud Detection Service Design sophisticated collaboration models with your domain experts Yes!
  10. 2) Strategic Design The three pillars of Domain-Driven Design 3)

    Modeling in Code 1) Collaborative Modeling 2) Strategic Design
  11. Subdomains & Bounded Contexts DDD Paradigm Customer Care Invoice Dispute

    Fraud Prevention Fraud Detection Billing Invoicing Crediting API C/S C/S C/S Internal Customer- Supplier Relationship
  12. 2) Strategic Design The three pillars of Domain-Driven Design 3)

    Modeling in Code 1) Collaborative Modeling 3) Modeling in Code
  13. Synchronous interfaces Billing Sync API Customer Care What looks like

    a simple, fast and atomic operation today, can tomorrow turn out to be … ANTI pattern
  14. Asynchronous interfaces Billing Async API Customer Care Feed Async APIs

    will NOT break, if you later need more than just a simple, fast, atomic operation to implement
  15. Objects & code inside the process Do not mix domain

    objects or domain code into your process model • No type safety or code completion! • Editing code in vendor-specific modelers? Nah. • Difficult or even impossible to test :-( • Complex domain objects as JSON ... seriously? process + objects + code Crediting ANTI pattern
  16. Processes as aggregates Model the process flow in a visual

    form 1 DDD Paradigm Invoice Dispute Process Model the domain objects in code 2 Invoice Dispute Root Entity 3 Bind them 1:1 and transition them as an aggregate 1 1 ${root}
  17. Defined consistency boundaries DDD Paradigm Update with an ACID transaction

    B A Aggregates Strong consistency Eventual consistency
  18. Thank you! BPMN DDD Process Automation with Domain-Driven Design ©

    Martin Schimak – plexiti GmbH – All rights reserved