Description
A Domain Event captures the memory of something interesting which affects the domain. It is strictly part of the domain model.
Where to use
- DDD (Domain-Driven Design). \n
- Decoupling side effects.
Real World Example
When a user changes their address, a 'UserAddressChanged' event is created, not just a database update. This allows other systems to react.
Code Example
class DomainEvents:
def __init__(self):
pass
def execute(self):
print('Executing Domain Events')
