-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from dogmatiq/113-apply-historical
Allow engine to call `ApplyEvent()` with historical events.
- Loading branch information
Showing
3 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# 14. Applying Historical Events to Aggregate Instances | ||
|
||
Date: 2020-10-19 | ||
|
||
## Status | ||
|
||
Accepted | ||
|
||
## Context | ||
|
||
Event sourcing engines need to call `AggregateRoot.ApplyEvent()` with | ||
"historical" event types. That is, event types that have already been recorded | ||
against the instance but are no longer configured for production by that | ||
aggregate. | ||
|
||
The current specification language prohibits this, as per the `ApplyEvent()` | ||
documentation: | ||
|
||
> It MUST NOT be called with a message of any type that has not been | ||
> configured for production by a prior call to Configure(). | ||
Additionally, without adding some new features to `AggregateConfigurer` it is | ||
impossible to declare an event as historical, meaning that there is no way to | ||
discover historical event types from the configuration. | ||
|
||
## Decision | ||
|
||
We have chosen to relax the language in the specification to allow calling | ||
`ApplyEvent()` with any historical event types in addition to those configured | ||
for production. | ||
|
||
## Consequences | ||
|
||
Existing event sourcing engine implementations are no longer violating the spec. | ||
|
||
As this is a documentation change only it does not provide engines with any | ||
information they need to determine if an event type is historical. This should | ||
be a non-issue as the engine itself will have its own mechanism for loading | ||
historical events. We may expand the functionality of `AggregateConfigurer` in | ||
the future to allow declaration of historical event types. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters