GetEventStore Multi-category projection

57 views
Skip to first unread message

Ricardo Enes da Silva

unread,
Nov 25, 2016, 9:22:35 AM11/25/16
to DDD/CQRS
If I have the following aggregates
- Clerk: Employee
- Manager : Employee

I require projections for
- ManagerSummary
- ClerkSuummary
- EmployeeSummary

I thought that I would subscribe to the category, $ce-, stream for Manager and Clerk, but what about Employ.
I could subscribe to both $ce-manager and $ce-clerk, but was hoping not to have touch the EmployeeSummary projection everytime a new Employee type is introduced to the system.

1. Does EventStore support multiple category projection if I create a stream as 'employee-manager-{AggregateId}' ?
2. If not, would it be a could practice to create a custom projection to do this or is there a better approach ?
3. When projecting to a category is the event assign the subsequent sequence number following the last event on the Category stream or does it retain this from its Original stream ?


Many thanks

Greg Young

unread,
Nov 25, 2016, 9:24:28 AM11/25/16
to ddd...@googlegroups.com
You can always write your own. $ce just bases on the first bit up to -
> --
> You received this message because you are subscribed to the Google Groups
> "DDD/CQRS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dddcqrs+u...@googlegroups.com.
> Visit this group at https://groups.google.com/group/dddcqrs.
> For more options, visit https://groups.google.com/d/optout.



--
Studying for the Turing test

Ricardo Enes da Silva

unread,
Nov 25, 2016, 9:30:42 AM11/25/16
to DDD/CQRS
Thanks Greg

Do I take it then that it is not entirely a bad idea ? 
and what of the event sequence number on the category stream (does it depend on whether I emit or link) ?

Greg Young

unread,
Nov 25, 2016, 9:37:34 AM11/25/16
to ddd...@googlegroups.com
If you link then you have 2 sequences, one for the category projection
one for where it was originally written.

On Fri, Nov 25, 2016 at 2:30 PM, Ricardo Enes da Silva
Reply all
Reply to author
Forward
0 new messages