kgrzybek / modular-monolith-with-ddd

Full Modular Monolith application with Domain-Driven Design approach.
MIT License
10.89k stars 1.71k forks source link

How to combine different module use cases #236

Open AkinSabriCam opened 2 years ago

AkinSabriCam commented 2 years ago

Hi @kgrzybek, firstly thank you for this great repository. I would like to talk about a case that I have in my project. For instance, we have 2 modules in our project. Let's call them Reservation and Profile modules I want to update my profile and before updating should check the reservation status which includes that profile. So, we have a process that includes 2 different modules use cases

Would you suggest that using IProfileModule and IReservationModule interfaces in the same endpoint or another handler? or Would you suggest that we should define these aggregates in the same module? or any other suggestion?

adturpin commented 1 year ago

Hello, May i suggest to see the problem from module point of view. When your Reservation Module update the status you can send domain even and catch with your Profile Module (apply some business transformation) and store the result, than you don't need to interact with many modules.

This is Hollywood Principle : "Don't Call Us, We'll Call You"

This issue is a bit older mmaybe you have found an other solution to share, I hope my comment can help you