5 Domain Model Implementation Patterns
WHAT’S IN THIS CHAPTER?
- The role of the domain layer in an application
- Patterns to implement your domain model in code
- How to select the right design pattern to represent your model
Wrox.com Code Downloads for This Chapter
The wrox.com code downloads for this chapter are found at www.wrox.com/go/domaindrivendesign on the Download Code tab. The code is in the Chapter 5 download and individually named according to the names throughout the chapter.
The focus of DDD is to manage complexity. As you have read, this is achieved by placing a model of the domain at the center of your software to fulfill the behaviors of your application. There are various patterns at your disposal to represent the model in code form. In Chapter 3, “Focusing on the Core Domain,” you were introduced to subdomains and the reality that more than one model may exist in large applications. However, not all models will be of equal complexity or importance. Some will contain complex domain logic, while others will simply be responsible for the management of data, therefore it is wise to choose the most appropriate design pattern to represent the model in code.
It is important to understand that there is no best practice when it comes to selecting a pattern to represent your domain logic. As long as you isolate domain logic from technical concerns you can implement Model-Driven Design and hence Domain-Driven Design.
This chapter presents the design patterns at your ...
Get Patterns, Principles, and Practices of 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.