This will greatly depend on where the boundaries of the sequence should be. It will also depend on what business rules you have.
While Meta-Knight has FriendRequest in the same aggregate, I would use it as my own and use events to communicate between the Aggregates, so I created Person, and FriendRequests was ultimately consistent. This will allow you to do something like.
public class DomainRouter { public void When(FriendRequestCreated event) {
Thus, information about a person will be just a state record. FriendRequest will be where the whole process takes place.
In DDD, it's important to think about behavior. FriendRequest request can be requested, withdrawn, accepted and rejected. What can a person do? Should the person be DDDd or could you make him beautiful and just CRUD + store the information in the graph database, etc.
Maybe you want to simulate it so that you can go person.requestFriendAcceptance (Person id), in which case the router will probably just handle the FriendRequestCreated event, notifying the FriendRequest friend.
Alistair
source share