The top level class for a design is the EventSourcingModel class. This has properties to identify the event sourcing model in use (name, description) and then contains a collection of AggregateModel class that identify the Aggregates (aggregate roots) in use in the system.

Properties
  • Name - The unique name by which the event sourcing model is known. (This is used to refer to this model in code and also in the default filename when saving the model)
  • Description - The documentation description of the model represented by this event sourcing model.
  • Aggregates - The set of aggregates belonging to this event sourcing model.

Code generation
This class can be populated from the .cqrsx (CQRS Model in XML) file e.g.:

<?xml version="1.0" encoding="utf-8"?>
<cQRSModel xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" dslVersion="1.0.0.0" Id="e262e6c3-3d49-450d-b078-6df3ef733855" xmlns="http://schemas.microsoft.com/dsltools/CQRSDesigner">
  <aggregateIdentifiers>
    <aggregateIdentifier Id="af61c4d4-fe7f-4dea-b004-545eca10f90b" name="Team" description="A team within the league" keyName="TeamName">
      <events>
        <aggregateIdentifierHasEvents Id="c8d60751-30da-45b9-940e-2ce8745cef36">
          <event Id="674452fa-cf46-470c-b724-fd659d6b5184" name="Registered" description="The team was registered with the league" />
        </aggregateIdentifierHasEvents>
        <aggregateIdentifierHasEvents Id="7cde76a8-000d-4805-abe5-4ad8362cc4b1">
          <event Id="f35c488d-e8e8-49ce-9a40-49ab15f9d5e6" name="KitChanged" description="The team colours were changed" />
        </aggregateIdentifierHasEvents>
        <aggregateIdentifierHasEvents Id="d9e0ba4a-8633-4ec7-95f4-bef38ed98507">
          <event Id="80eb8698-f7ae-496d-9c63-9d52b00baf60" name="GroundChanged" description="The home ground was changed" />
        </aggregateIdentifierHasEvents>
      </events>
      <projections>
        <aggregateIdentifierHasProjections Id="43a41b9e-63a6-4073-bf7a-f1b29b49ac16">
          <projection Id="2fcb4b73-6912-4b85-90e1-62678b6d25af" name="Summary" description="The summary information about the team" />
        </aggregateIdentifierHasProjections>
      </projections>
    </aggregateIdentifier>
    <aggregateIdentifier Id="484970b6-fe99-4873-8c5b-64b21da4ed28" name="Player" description="A player registered with the league" keyName="RegistrationNumber" keyDataType="Integer">
      <events>
        <aggregateIdentifierHasEvents Id="156afb07-9a46-4ea9-97d7-a27eb8966791">
          <event Id="68f530ab-5aeb-44be-938c-729651772d4d" name="Signed" description="The player signed up for a club" />
        </aggregateIdentifierHasEvents>
        <aggregateIdentifierHasEvents Id="bae869c7-d87d-4269-be47-966f6dd33c8a">
          <event Id="b8523199-4a6b-488f-b475-249c5edcfb92" name="StartedMatch" description="Player started a game on the pitch" />
        </aggregateIdentifierHasEvents>
      </events>
    </aggregateIdentifier>
  </aggregateIdentifiers>
</cQRSModel>

Last edited May 25, 2015 at 2:22 PM by Merrion, version 3