Questions tagged [domain-events]
130 questions
1
vote
1 answer
DDD Relate Aggregates in a long process running
I am working on a project in which we define two aggregates: "Project" and "Task". The Project, in addition to other attributes, has the points attribute. These points are distributed to the tasks as they are defined by users. In a use case, the…
user11033188
1
vote
1 answer
DDD Events Between Aggregates Example
I have two aggregates
item and price adjustment.
A price adjustment will contain an item adjustment which will say, for a specific item, raise it by x percent (e.g. 10%)
my item has a list price which is what needs to be updated/adjusted.
so when…

Matster2
- 137
- 1
- 14
1
vote
2 answers
Handling Eventual Consistency fail between aggregates
I am a beginner in DDD and I came across a situation that involves a rule of not modifying more than 1 aggregate in the same transaction, using Domain Events to resolve changes in other aggregates. (see Effective Aggregate Project).
The situation is…
user11033188
1
vote
1 answer
@TransactionalEventListener annotated method not invoked in @Transactional test
I'm trying to implement domain event publishing from an entity by following the examples mentioned on the post below:
Example for @DomainEvents and @AfterDomainEventsPublication
However I haven't managed to have Spring calling my method annotated…

franDayz
- 883
- 10
- 22
1
vote
1 answer
Reliable Asynchronous Handling of Domain Events
In concurrent systems, domain events are typically handled asynchronously. In Go, a simple approach for asynchronous event handling can be implemented via channels, but the issue is that if something bad happens for handling an event, or worst, for…

Alirus
- 472
- 4
- 14
1
vote
2 answers
How to deal with the aggregate root without repository, when using Spring Data Common to publish domain events
The logic is: publish an event to notify closing a netty channel. Before, through DomainEventPublish, I publish the event at domain service, application service, or catch. Now, I found that it was wrong because only aggregate root can publish domain…

Oliver Liu
- 13
- 5
1
vote
1 answer
Am I over-complicating this? (CQRS, Domain Events, and Command Failures)
I'm working on a CQRS framework with domain events and I'm coming across a code smell that I would like some advice on.
I'm NOT using event sourcing (ES). ES events are not the same as domain events. A domain event is interesting to the domain and…

Jason
- 349
- 3
- 9
1
vote
1 answer
Calling cross-aggregate calculation function to update read model after a command applied
I'm new to CQRS and need advice on the following situation in my design. A command updates state of an aggregate A; the read model needs to be consequently updated with a result of a cross-aggregate calculation method; this method belongs to another…

Pavel S.
- 1,202
- 1
- 13
- 29
1
vote
0 answers
Domain Events Implementation Using StructureMap Error
I am trying to grasp the fundamentals of raising/handling a Domain Event in my Solution. I am using Visual Studio 2017, .Net Core 1.1, C#, StructureMap 4.5.1.
The failure in my code came to light in a Unit Test which failed when checking if my…

TDC
- 1,869
- 3
- 25
- 40
1
vote
2 answers
Domain events and DB generated ID as a part of atomic process
I am using eventual consistency and domain events in DDD an I have encountered the following issue.
When creating domain object using factory I can generate a GUID, but cannot get a DB generated ID in order to return a valid ID as a part of the…

mko
- 6,638
- 12
- 67
- 118
1
vote
1 answer
How to publish Domain Events from Domain objects using StructureMap and current request container?
I'm trying to create an application with DDD, implementing Domain Events, using Entity Framework and StructureMap for dependency injection.
I created an abstraction of UnitOfWork and Repositories. Obviously, the IUnitOfWork implementation…

Gabriel Roldan
- 51
- 2
- 4
1
vote
1 answer
Where to subscribe to domain events
Within my application service, I have the following code for publishing domain events:
var document = await dbContext.Documents.GetAggregateAsync(message.DocumentId);
publisher.SubscribeTo()
.UsingDelegate(
async a…

Marco
- 2,453
- 3
- 25
- 35
1
vote
1 answer
Domain Events for confirming state
I have a question about Domain Events. I am implementing an application using DDD and yes the application is complex enough for DDD.
The scenario I have is a Login Wcf Service, besides validating the User credentials and returning a Token the…

Neil Stevens
- 3,534
- 6
- 42
- 71
1
vote
2 answers
Should every object be modeled as aggregates, entities or value objects in DDD?
I am employing DDD (including domain events) and CQRS (without Event Sourcing) in the design of a social network website.
I have aggregate roots like User, FriendRequest, Friendship. I also have domain events like UserAddressChanged,…

foresightyj
- 2,006
- 2
- 26
- 40
1
vote
1 answer
Domain events for local consumption in DDD
I'm familiarizing myself DDD lately and trying to get hold of the key concepts and I have a query incase of publishing domain events for the local subscribers, so can I assume that the event publisher, takes care of both publishing to remote…

Somasundaram Sekar
- 5,244
- 6
- 43
- 85