Exploring Factories, Repositories, and Services
Factories, repositories, and services are the last major building blocks of domain-driven design (DDD) that we will learn about before bringing everything together in Part 2 of this book, where we will build some services from scratch.
None of the factories, repositories or services are unique to DDD and are often used in projects not using the DDD approach. This makes them especially important and useful to learn about, as you will see them everywhere.
In this chapter, we will cover the following topics:
- The factory pattern – we will discuss what it is and when it is useful
- The repository pattern – we will walk through some examples to help you understand how they differ from database tables
- Services – we will look at domain services, application services, and infrastructure services and the difference between them all
By the end of this chapter, you will be able to understand factories...