Classifier - MerrionComputing/CQRSAzure GitHub Wiki

A classifier is a special type of projection whose only purpose is to decide if a given instance of an aggregate is in or out of a specified identity group.

This allows for business-term restrictions of the target of either queries or commands in the CQRS architecture which are somewhat analogous to the where clause part of an SQL system, but without having to know how the business rule is implemented.

A classifier that uses an invariant rule over an event stream is itself immutable and therefore the identity group can have a backing event stream like data structure that describes what instances are in that group at any given point in time.

Example

If we use the CQRS Farm example we have an aggregate type "Cow". Events can occur to an instance of this - being born, being sold etc. that affect whether the cow can be considered part of the identity group "the current herd". You can then use this identity group to perform queries like "Of the cattle that were in the current herd on 2014-02-01 which ones have had a magnesium bolus"