Skip to content
smhinsey edited this page Jan 20, 2012 · 25 revisions

Summary

An Agent represents a logical unit of value in terms of either a business or technical concern.

Architectural Styles

Euclid provides frameworks to support agent design in the following architectural styles.

  1. Basic CQRS -- Command processors persist command payloads as read models. Read models are persisted into repositories.
  2. Basic Event Sourcing -- Denormalizers transform event payloads into read models. Events take the place of commands entirely in this style. Read models are persisted by the event sourcing framework.
  3. CQRS/DDD -- Aggregate roots apply commands to themselves which modify their current state and persist it to read models. Aggregate roots and read models are both persisted into repositories. Persisted aggregate roots make up the domain model store, which can be fully normalized and used for reporting. When an aggregate root is modified, it is denormalized into a read model store.
  4. CQRS/DDD/ES -- Aggregate roots apply commands to themselves which modify their current state and publish it via events which are denormalized into read models. Aggregate roots are persisted into repositories. Read models are persisted by the event sourcing framework. As with CQRS/DDD, the persisted aggregate roots make up the domain model store, which can be fully normalized and used for reporting.

Agent Parts

Depending on the specific need it is being developed to meet, an Agent consists of one or more of the following parts.

Read Models

Read models define the schema of the data under management by the Agent. Read models should map as closely as possible to particular screens in a composite. For a general purpose Agent that is intended to be reused by multiple composites, the read models should still seek to map directly to composite views as far as it is reasonable to do.

Queries

Queries represent requests for specific read models. In order to encourage scalable and highly performing systems, a composite should issue as few queries as possible in the process of rendering a view.

Commands/Actions

Commands are generally published by a composite in response to user input. This can take the shape of forms which have been filled out and submitted, button clicks, or any other user generated event. For some Agents, commands can be published from other Agents or have other non-user origins.