Skip to content

Add HasDomainEvents interface to register,get,clean aggregate's events#189

Open
Amir2244 wants to merge 5 commits intoxmolecules:mainfrom
Amir2244:ddd-aggregate-events
Open

Add HasDomainEvents interface to register,get,clean aggregate's events#189
Amir2244 wants to merge 5 commits intoxmolecules:mainfrom
Amir2244:ddd-aggregate-events

Conversation

@Amir2244
Copy link
Copy Markdown

No description provided.

Add @stereotype(priority = 20) to HasDomainEvents, matching Identifiable
as both are capability traits rather than primary DDD building blocks.
This ensures HasDomainEvents never outranks the AggregateRoot (priority 0)
it supplements.
  so implements HasDomainEvents with abstract methods won't compile. Default methods let it compile, then ByteBuddy overrides them
…ration

HasDomainEvents<T, E> exposes getDomainEvents/clearDomainEvents for infrastructure.
DomainEvents<E> provides encapsulated event registration as a private aggregate field,
solving the interface encapsulation problem via composition instead of a public registerEvent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant