-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update the 'View' trait #116
base: main
Are you sure you want to change the base?
Conversation
@@ -23,8 +23,10 @@ pub trait Query<A: Aggregate>: Send + Sync { | |||
/// A `View` represents a materialized view, generally serialized for persistence, that is updated by a query. | |||
/// This a read element in a CQRS system. | |||
/// | |||
pub trait View<A: Aggregate>: Debug + Default + Serialize + DeserializeOwned + Send + Sync { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a View
shouldn't even know what an Aggregate
is, it should only care about (and know about) events.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #116 +/- ##
=======================================
Coverage 87.35% 87.35%
=======================================
Files 32 32
Lines 3376 3376
=======================================
Hits 2949 2949
Misses 427 427
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
0d855c3
to
791fc4a
Compare
791fc4a
to
13a042a
Compare
50378c2
to
85c35b0
Compare
@davegarred any thoughts about the questions in the summary of this PR? |
aligns the 'View' trait and the 'Aggregate' trait more closely.
the View trait seems to be a synonym for a projection. An Aggregate is really a special case of a projection (that also handles commands), so it makes sense for these to be aligned.
I would like to take this further and have the Aggregate trait 'inherit' the View trait, but there are a couple of inconsistencies
i think this PR stands up even without resolving the above questions, but if they can be resolved than the
Aggregate
trait can be changed fromto