Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The first thing to identify is the set of <strong>events</strong> that you're interested in. You already have some examples such as when the order shipment is late, invoice retrieval is late, etc. From the business perspective, these events have a specific meaning and specific consequences. Deciding on criteria for these events should be done in conjunction with domain experts - they should be able to say things like "when the order isn't shipped after 1 day so and so should happen". </p> <p>This of course is different from implementing this <a href="http://en.wikipedia.org/wiki/Event-driven_architecture" rel="nofollow">event-driven architecture</a>. One way to implement the above time triggered events is to run a continuous process which runs a query on a schedule. This query would retrieve the set of entities which satisfy the criteria for the event at the time the query is run. The resulting system would publish these time triggered events. The NServiceBus handler for those events would delegate the handling of the event to the domain layer.</p> <p>Regarding the where, I agree that the definition and handling of these events will usually be tied to a specific bounded context. They could however span multiple BCs such as when an event from one BC is handled in another BC. As far as the physical placement of code, the event handler should go near the corresponding domain logic. For instance, you may have a shipping BC with a requirement to dispatch a message whenever shipping is late. In this case, the whole workflow would be contained in a single BC which could be implemented with a single VS solution.</p> <p>The how of these events should be part of the infrastructure as described above. On the other hand, the handling of the events should be delegated to domain layer. For instance, you can have infrastructure that publishes <code>OrderShippingIsLate</code> messages with NServiceBus. In the shipping BC solution, you'd have a NServiceBus handler for this message type, which would invoke an application service which handles this message (by adding a task for a support rep, dispatching some sort of warning, etc).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload