Service call...

20 views
Skip to first unread message

Napoleon

unread,
Aug 2, 2011, 2:21:49 AM8/2/11
to DDD/CQRS
Hi all,

I have the following workflow:

After a user has entered its details, he chooses a product he wishes
to buy. When the product has been selected, and product options
entered, a quote service will be called to figure out how much the
product is going to be. The price may vary on the options selected,
but also, the quote service may return some invalid selection errors
depending on the user details (such as the user's age).

My question is, should the quote service be called before the domain
event is published (i.e. UserHasChoosenAProductEvent) and thus giving
the UI a chance to display the potential quote service errors, or
should I publish the event, and let a consumer call the quote service.
If the latter, I would imagine that the error returned should then be
stored alongside the quote record to be displayed in another view.

Or is there a better approach?

Y.

thang chung

unread,
Aug 2, 2011, 4:37:49 AM8/2/11
to ddd...@googlegroups.com
Hi Napoleon,

I think this http://codebetter.com/gregyoung/2010/08/12/eventual-consistency-and-set-validation/ from Greg will make you give a better solution.
--
==========================================================
Regards,
ThangChung,
http://weblogs.asp.net/thangchung
Reply all
Reply to author
Forward
0 new messages