You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Application layer elements, like Application Services, Command Handlers, and Event Handlers, are the primary mechanisms that interact with the persistence store. They fetch repositories associated with aggregates, load aggregates from the database when necessary, and add the changed repository objects back into the store.
It is advantageous to wrap the methods in this layer to run within a UnitOfWork(UoW). While the established guideline is to restrict all state changes to one single aggregate per change, a UoW further ensures that transactional integrity is preserved. It also ensures all events generated at the domain layer are published/dispatched only after a successful commit.
We can accomplish this by wrapping classes/functions as they are registered with the domain:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Application layer elements, like Application Services, Command Handlers, and Event Handlers, are the primary mechanisms that interact with the persistence store. They fetch repositories associated with aggregates, load aggregates from the database when necessary, and add the changed repository objects back into the store.
It is advantageous to wrap the methods in this layer to run within a
UnitOfWork
(UoW). While the established guideline is to restrict all state changes to one single aggregate per change, a UoW further ensures that transactional integrity is preserved. It also ensures all events generated at the domain layer are published/dispatched only after a successful commit.We can accomplish this by wrapping classes/functions as they are registered with the domain:
Beta Was this translation helpful? Give feedback.
All reactions