How do you handle commands in an Domain Service in ncqrs?

48 views
Skip to first unread message

Jason

unread,
Dec 29, 2011, 2:33:19 PM12/29/11
to ncqrs-dev
I need to handle a command that affects two different aggregate root
types (across a bounded context). My understanding is that this
should be done in a Domain (Application) Service.
Where and how should I handle this in ncqrs?

Thanks.

@marcofranssen

unread,
Dec 30, 2011, 9:15:44 AM12/30/11
to ncqrs-dev
First of all you have to know that one command should only affect a
change to one AR. This because of your scalability. Second you have to
know a command is always be executed from the command executor.
Possibly you have to redesign your domain so the command should only
affect one AR. The last thing you can do is implement a SAGA. A saga
is ment for keeling track of long running operations. However first
try to redesign you domain. I'm not completely sure how to implement a
saga with ncqrs. Possibly someone else can help you with that one.

Jason Aminto

unread,
Dec 30, 2011, 10:23:21 PM12/30/11
to ncqr...@googlegroups.com
You are right, "affect" was not the ideal word.  I simply meant that i need to execute a command that can't be just routed directly to a single AR.  

I think the answer i was looking for is that command executors are the ncqrs version of a Domain Service.  Is that correct?
Reply all
Reply to author
Forward
0 new messages