Domain-Driven Design: Concepts, Patterns, and Implementation
1. Repository and Factory in Domain Modeling
1.1 Repository
In a domain model, numerous domain objects exist, each with its own life - cycle. A repository is a central object that manages references to all available domain objects. It interacts with infrastructures like databases or file systems to retrieve persisted objects.
The main advantage of using a repository is that it provides a consistent way to retrieve objects without the requester having to interact directly with storage. For example, if you need a customer with ID 31, you query the repository. If the customer object is already in the repository, it is returned; otherwise, the repository fetches it from storage.
超级会员免费看
订阅专栏 解锁全文
1931

被折叠的 条评论
为什么被折叠?



