You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for this nice Project. It's very hard to find something simular on github.
At the moment, I'm writing my Bachelor Thesis about Domain Driven Design and i have searched a long time to find an answer for my problem, but i'm too stupid to find one or search with the wrong Keywords.
So please be gracious ;)
Scenario:
A Bounded Context "Hotel" in which the Aggregate Room is Managed.
Bounded Context "Tasks" in which the Aggregate Task is managed.
Now, when I'm creating a new Task, have to check, if a Room with the given Guid exists.
I tried to find a similar Scenario in the project, but i cloudn't. When, for example, a CreateMeetingCommand is handled, the Program doesn't check, if the Host Members exists (or am I to silly to find the check?). But then you can create Aggregates, with not existing Members.
Or other example: A Meeting have a Name and only Members are allowed to attend with the same Firstname (stupid example, but the idea is clear). How can the Program check this?
The Naiv Approach is to execute the GetAllRoom-Rest and check if the Guid matches.
But this is bullshit.
In the Readme is mentioned that: IntegrationEvents - Contracts published to the Events Bus; only this assembly can be called by other modules
So i have to work with IntegrationEvent? Such CreatedNewTaskEvent? But when happen the Check for the Room?
Or does the Hotel Module answers this Event with an TaskCanBeCreatedEvent? But then the Hotel Module has to implement Logic of the Task-Module.
Also often mentioned is, that the Task Module should keep Track of the Hotel Module. But i don't like the idea, what if the Task Module is made 2 Years after creating the Hotel BC?
Other Way: An Helper Class which implements a Interface Like IRoomHelper which has a Method GetAllRooms and how this Interface is implemented can be changed dynamically
If you really want to put Room and Task to separate Bounded Context and during Task creation you want to check whether there is a 'Room' for a given RoomId you have two options:
integrate both Bounded Context using IntegrationEvent: When Room is created, RoomCreatedIntegrationEvent is published and Task BC subscribes to this event and stores this information in its own state. It means Task BC has a copy of this data. This is the preferred approach because it decouples both BC. Also often mentioned is, that the Task Module should keep Track of the Hotel Module. But i don't like the idea, what if the Task Module is made 2 Years after creating the Hotel BC? You need to migrate this data and this is fine. You can create for instance some ETL mechanism or publish initial events.
integrate using sync call: Room BC will expose API to verify if given RoomId is valid. This is an option when you always need fresh data, want to avoid broker and messaging in general. However, it couples both modules and they lose autonomy then.
Are you sure that these concepts are from different Bounded Contexts? It is hard for me to answer this question because I don't know the domain which you are modeling. You need to be careful about this and this is what Strategic DDD is about.
first of all thanks for your reply. This helps a lot.
Tasks and Rooms are different BCs, because some other Modules also need the Room and maybe some Hotels won't use the Taskmanagement, but the Defectmanagement, which also needs the Rooms.
Is it ok, to make one Init-IntegrationEvent, which when triggered forces all Modules to emit for example for each Room an RoomInitIntegrationEvent? Then all BCs can ether correct thier storage or init the storage.
Cause if one Component of the System is down (the Task-DB is not available) all Events in this time are lost. So with this measure, the System is more robust. It's also possible to trigger this Init-Event every day at midnight To be sure, that all Systems are in Sync.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
First of all, thank you for this nice Project. It's very hard to find something simular on github.
At the moment, I'm writing my Bachelor Thesis about Domain Driven Design and i have searched a long time to find an answer for my problem, but i'm too stupid to find one or search with the wrong Keywords.
So please be gracious ;)
Scenario:
A Bounded Context "Hotel" in which the Aggregate Room is Managed.
Bounded Context "Tasks" in which the Aggregate Task is managed.
Now, when I'm creating a new Task, have to check, if a Room with the given Guid exists.
I tried to find a similar Scenario in the project, but i cloudn't. When, for example, a
CreateMeetingCommand
is handled, the Program doesn't check, if the Host Members exists (or am I to silly to find the check?). But then you can create Aggregates, with not existing Members.Or other example: A Meeting have a Name and only Members are allowed to attend with the same Firstname (stupid example, but the idea is clear). How can the Program check this?
The Naiv Approach is to execute the
GetAllRoom
-Rest and check if the Guid matches.But this is bullshit.
In the Readme is mentioned that:
IntegrationEvents - Contracts published to the Events Bus; only this assembly can be called by other modules
So i have to work with IntegrationEvent? Such
CreatedNewTaskEvent
? But when happen the Check for the Room?Or does the Hotel Module answers this Event with an
TaskCanBeCreatedEvent
? But then the Hotel Module has to implement Logic of the Task-Module.Also often mentioned is, that the Task Module should keep Track of the Hotel Module. But i don't like the idea, what if the Task Module is made 2 Years after creating the Hotel BC?
Other Way: An Helper Class which implements a Interface Like
IRoomHelper
which has a MethodGetAllRooms
and how this Interface is implemented can be changed dynamicallyBeta Was this translation helpful? Give feedback.
All reactions