Questions tagged [domain-events]

121 questions
7
votes
2 answers

Domain event handlers - Should they be used for Application layer concerns?

When implementing Domain events should the event handlers be only used for purely domain concerns; something that you would discuss with the business experts, or are they open to be used by anything that has an interest in the domain model? This is…
Andronicus
  • 1,711
  • 1
  • 13
  • 27
7
votes
2 answers

Domain Event pattern implementation in Java?

I'm searching for a simple Java implementation of Udi Dahan's Domain Events pattern and infrastructure as detailed in this article. It's pretty simple and I've implemented my own interpretation, however I'm a Java novice and don't want to be bitten…
HolySamosa
  • 8,339
  • 13
  • 62
  • 97
6
votes
3 answers

How are domain events dispatched from within domain objects?

Domain objects shouldn't have any dependencies, hence no dependency injection either. However, when dispatching domain events from within domain objects, I'll likely want to use a centralised EventDispatcher. How could I get hold of one? I do not…
Double M
  • 1,313
  • 1
  • 8
  • 24
6
votes
2 answers

CQRS - can EventListener invoke Command?

I want to use elements of CQRS pattern in my project. I wonder if i do it right with Command and Events. The thing that I'm not sure is if event can invoke command. To better show what i want to do I will use diagram and example. This is an…
geek
  • 558
  • 6
  • 23
5
votes
2 answers

structuremap ObjectFactory.GetAllInstances>()

I am having a rough time implementing eventing in a recent project. I have verified that structuremap is scanning properly assemble and adding EventHandlers Scan(cfg => { cfg.TheCallingAssembly(); …
TheMar
  • 1,864
  • 2
  • 29
  • 51
5
votes
2 answers

DDD - How handle transactions in the "returning domain events" pattern?

In the DDD litterature, the returning domain event pattern is described as a way to manage domain events. Conceptually, the aggregate root keeps a list of domain events, populated when you do some operations on it. When the operation on the…
Normand Bedard
  • 2,375
  • 2
  • 15
  • 18
5
votes
2 answers

Where does the message bus service live in Domain Driven Design

I am trying to further my understanding of DDD. More specifically, how to handle domain events via a message bus for asynchronous processing. Lets say I have some architecture -> _____________________ | | | Client …
drizzie
  • 3,031
  • 2
  • 20
  • 29
5
votes
2 answers

DDD generic vs. specific domain events

I'm looking at domain events, specifically at 2 possibilities: A. Using "generic" events like that: public class OrderStateChangedEvent : IEvent { public Guid OrderId { get; } public OrderState NewState { get; } } then the consumer would figure…
Lev
  • 287
  • 1
  • 11
5
votes
4 answers

Domain events and versioning without CQRS

Hi I have the following senario which I dont understand how to get eventual consistency with: User 1 uses Task based ui to change customer name App Service calls operation on the aggregate Aggregate fires event on customername changed bus sends…
5
votes
1 answer

Using Ninject with Udi Dahan's Domain Events

I'm using Ninject in an MVC project and am trying to implement Domain Events following Udi Dahan's pattern http://www.udidahan.com/2009/06/14/domain-events-salvation/ In the extract below, the "Container" is used to resolve all the event-handlers…
4
votes
4 answers

Best practice for naming Event Types in Event Sourcing

When building an event store, the typical approach is to serialize the event and then persist the type of the event, the body of the event (the serialized event itself), an identifier and the time it occurred. When it comes to the event type, are…
Steven
  • 633
  • 4
  • 13
4
votes
1 answer

Domain Events v Event Aggregator v... other

I have a composite structure in my domain where the leaf node (Allocation) has a DurationChanged event that I would like to use at the top of my presentation layer view model structure (in the TimeSheetViewModel), and I am wondering what the best…
Berryl
  • 11,796
  • 21
  • 88
  • 170
4
votes
2 answers

Should the rule "one transaction per aggregate" be taken into consideration when modeling the domain?

Taking into consideration the domain events pattern and this post , why do people recomend keeping one aggregate per transaction model ? There are good cases when one aggregate could change the state of another one . Even by removing an aggregate…
4
votes
0 answers

Handling Domain Events asynchronously

I have implemented domain events as prescribed in Udi Dahan's Domain Events - Salvation article. As far as I understand, domain events can be run asynchronously to the thread from which it was raised (typically from a domain model or service). …
4
votes
1 answer

Domain Events pattern single point to queue events

I put a question here: Raising Domain Events For Multiple Subscribers and the answer led me to the following pattern where I can have an IEventPublisher like so: public interface IEventPublisher { void Publish(T data); } and an…
user351711
  • 2,741
  • 4
  • 31
  • 63
1
2
3
8 9