Wrap-Up
We examined the reasons for using Factories in DDD and how they often fit into the model.
• You now understand why the use of Factories can produce expressive models that more closely adhere to the Ubiquitous Language in context.
• You’ve seen two different Factory Methods implemented as Aggregate behaviors.
• This helped you learn how to use Factory Methods to create Aggregate instances of other types, all while ensuring the correct production and use of sensitive data.
• You also learned how Domain Services can be designed as Factories, even interacting with other Bounded Contexts and translating foreign objects to local types.
Next, we’ll take a look at how Repositories can be designed for two primary styles of persistence, along ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access