Factory Method on Aggregate Root

Throughout the three sample Bounded Contexts there are Factory sites on Aggregate Root Entities, of which Table 11.1 provides a summary.

Table 11.1. Sites of Factory Methods on Aggregates

Image

I discuss the Product Factory Methods under Aggregates (10). For example, its method planBacklogItem() creates a new BacklogItem, which is an Aggregate that is subsequently returned to the client.

To demonstrate the design of Factory Methods, let’s look at the three in the Collaboration Context.

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.