My software is a kind of social network where members can, among other features, schedule some meetings between them.
I chose to emerge those three bounded contexts (DDD):
- IdentityAndAccessContext, basically dealing with user authentication/authorisation.
- SocialContext, dealing with Members and all social information about them; their interests etc., akin a classical social network.
- MeetingsContext, dealing with meetings between some members. We're talking about translated Value Objects as Creators/Attendees/Participants etc.
Basically, in the MeetingsContext, the meeting's creation use case demands a list of members (in order to invite some of them), basically through a Web form where user selects some members presenting some interesting but light social information.
As you may figure out, SocialContext is clearly the master of members data in a social way.
Should I create a kind of Open Host Service in the SocialContext returning some relevant members data for the use case?
It would be consumed by MeetingsContext directly (REST protocol), maybe through an Anti-Corruption Layer if needed.
Or should I rather cache or even maybe duplicate relevant member's data in the MeetingsContext to improve it's self-contained aspect?
With the caching solution, the cache would be sync in an eventual consistency manner.
What is a good practice in this case?
IdentityAndAccessContext
isn't a bounded context or domain concept at all. Identity and access (authorization, authentication, acl etc.) are application concerns, not domain concerns are to be handled at application level, not on domain level – TsengSocialContext
with the idxyz
" and this is clearly a responsibility of the application, not the domain – TsengSocialContext
Person
orEmplyoee
are the domain entities/aggregates. You can't "Block an emplyoee", this is nowhere a part of a business process. You can just assign (to a group/tenant/company/etc)/remove/delete it. Identity is something completely different. Identity (in simplest case) may only consists of a username, a login and an associated id (i.e. person id), so you can tell: "S/he has confirmed that s/he is this person". Nothing more, no business logic involved, its all application concern. – Tseng