Events Enrichment

One of the more common problems with A+ES designs comes from their dual purpose. Events are used both for Aggregate persistence and to communicate domain-level happenings around the enterprise by means of Event publishing.

For example, consider the following: A project management system allows customers to create new projects and archive completed projects. Imagine that we publish a ProjectArchived Event each time a user archives a project. This Domain Event could have this design:

public class ProjectArchived {   public ProjectId Id { get; set; }   public UserId ChangeAuthorId { get; set; }   public DateTime ArchivedUtc { get; set; }   public string OptionalComment { get; set; } }

This information ...

Get Implementing Domain-Driven Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.