Questions tagged [domain-events]

121 questions
34
votes
6 answers

Where to raise persistence-dependent domain events - service, repository, or UI?

My ASP.NET MVC3 / NHibernate application has a requirement to fire off and handle a variety of events related to my domain objects. For example, an Order object might have events like OrderStatusChanged or NoteCreatedForOrder. In most cases these…
30
votes
6 answers

Communicating between two Bounded Contexts in DDD

I have few different Bounded Contexts in the domain. The validation of a CRUD operation is built in each Bounded Context. For example, I can create an entity called GAME only if the person creating it is a Group Leader. I have two Bounded Contexts…
wonderful world
  • 8,704
  • 14
  • 76
  • 142
21
votes
2 answers

Should domain events be raised within or outside of a transaction?

In our application we raise domain events when something changes in the domain model. Some of the tasks that are performed by the event handlers must be done within the same transaction that was used when the event is raised, other tasks must be…
Andronicus
  • 1,711
  • 1
  • 13
  • 27
14
votes
2 answers

Using Autofac with Domain Events

I'm trying to introduce domain events into a project. The concept is described in Udi Dahan's post - http://www.udidahan.com/2009/06/14/domain-events-salvation/ Here's the domain event code public interface IDomainEvent { } public interface…
CRG
  • 467
  • 1
  • 5
  • 15
13
votes
1 answer

CQRS and Domain Events

CQRS has got me into thinking mode.. I am tryinng to start a new project with CQRS ideas. The main things that I like is 1) the separation of Query and Command. Our Domain queries have been a problem. 2) Using Event Storage for Audit - I wont be…
TheMar
  • 1,864
  • 2
  • 29
  • 51
12
votes
2 answers

Delaying the creation and dispatch of domain events

I've been using the Domain Events pattern for some time - it enables us to encapsulate as much behaviour in our domain layer as possible and provides a nice way for other parts of our application to subscribe to domain events. Currently we're using…
Ben Foster
  • 32,767
  • 35
  • 157
  • 274
12
votes
1 answer

New entity ID in domain event

I'm building an application with a domain model using CQRS and domain events concepts (but no event sourcing, just plain old SQL). There was no problem with events of SomethingChanged kind. Then I got stuck in implementing SomethingCreated…
Pein
  • 1,196
  • 7
  • 15
11
votes
3 answers

Looking for examples of Domain Events

Does any one know where to find example code for an implementation of Domain Events as described by Udi Dahan in Domain Events – Salvation?
Roman
  • 9,886
  • 13
  • 60
  • 96
11
votes
2 answers

Showing changes in View when using CQRS & DDD with Domain Events & ServiceBus

I'm a little confused about the flow in a system using domain events to build the read model. Particularly, how do we deal with the fact that the user expects data (and its view) to change when they complete a command, but due to our system…
10
votes
1 answer

When do domain event handlers come into play?

I have a simple examle domain of two aggregate roots and one regular entity. Tenant, UserGroup and User where in this particular sample the Tenant and User make up for the two AggregateRoots. When a command is received from the UI/Service layer it…
Jaapjan
  • 3,215
  • 18
  • 24
8
votes
1 answer

Domain events that trigger other domain changes in CQRS

In all the examples of CQRS I've seen, the domain events trigger updates to the read model but nothing else. But what about when you want a domain event to cause other changes in the domain? For example, assume you have the following…
Trystan Spangler
  • 1,595
  • 10
  • 19
8
votes
1 answer

Serialize and Deserialize domain events to persist and retrieve from Event Store in generic implementation

I am using DDD with CQRS and Event Sourcing. I need to use an Event Store (specifically this event store) within my custom implementation of IEventStore to persist and retrieve domain events but I am having difficulties with the approach to take…
diegosasw
  • 8,724
  • 7
  • 66
  • 106
8
votes
2 answers

Persistence and Domain Events with persistence ignorant objects

I've been studying on domain driven design in conjunction with domain events. I really like the separations of concerns those events provide. I ran into an issue with the order of persisting a domain object and raising domain events. I would like to…
Henk Mollema
  • 36,611
  • 11
  • 79
  • 100
8
votes
2 answers

CQRS and synchronous operations (such as user registration)

I'm in the process of adopting DDD concepts for designing our next projects, and more specifically CQRS. After reading a LOT of stuff I'm now trying to implement a simple Proof Of Concept. The thing is I'm stuck right after I started :p I'm trying…
Benjamin
  • 372
  • 4
  • 12
7
votes
1 answer

Domain driven design and domain events

I'm new to DDD and I'm reading articles now to get more information. One of the articles focuses on domain events (DE). For example sending email is a domain event raised after some criteria is met while executing piece of code. Code example shows…
Karel Frajták
  • 4,409
  • 20
  • 33
1
2 3
8 9