IEventSource/AggregateRoot Id

Jun 13, 2010 at 6:08 AM

Is it necessary for IEventSource/AggregateRoot to store its "globally unique identifier" in a property named "Id"?

Does the IEventSource Id necessarily have to correspond to the Domain Entity identity?

If the answer is no for either of those questions, would it be beneficial to store the Ncqrs "globally unique identifier" in a differently named property? For example, EventSourceAggregateId or something?

My primary motivations for this are:

  • To support brownfield domain models which have aggregate roots with identifiers that are not GUIDs

  • To support domain models with entities that are (concurrently) hooked up to "legacy" persistence frameworks

Ultimately, my goal is to be able to hook up Ncqrs to an existing domain model, use the Ncqrs command, command handling, event, and event handling portions, but for the repository layer, elect not to use the event sourcing right away, and instead persist entities the old fashioned way.

From what I can tell, the Axon (Java) CQRS framework seems to support such a scenario.

What do you think?