Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does application event term exist in DDD?

Domain events are well known in DDD, which can be published in Aggregate Roots or in Domain Services. My question here is, Can domain events be published in application services/use cases?

For example, simplifying. I have an application service called UseCaseA, which performs various operations calling some aggregate roots. If I want to raise an event when this use case ends, could I publish the UseCaseAFinished event within this application service? Is it a domain event or should it be called an application event? Does application event terminology exist in DDD?

Thanks in advance.

like image 233
Mr. Mars Avatar asked Jul 31 '26 05:07

Mr. Mars


1 Answers

Can domain events be published in application services/use cases?

Usually not: domain information belongs to the domain model, not to the application.

Now, it is normal for the business to be interested in the progress/termination of a process. But that's just a clue that suggests that the process itself is something that should also be modeled in the domain.

"Application events" would be more likely dedicated to application concerns: think "observability".

like image 77
VoiceOfUnreason Avatar answered Aug 03 '26 07:08

VoiceOfUnreason