<ddd--领域驱动设计学习>讨论--------仓储
<ddd--领域驱动设计学习>讨论--------仓储
仓储委托合适的基础结构来完成自己的工作,把存储,检索,查询封装起来还是仓储的实现的最基本的特性。
还有看到网上的一句话:
“可以理解Repository就是对Dao的封装,不同点在于Repository只返回model或者model的集合,而dao则可以返回的更多比如返回一些统计数据。”
---------是不是还可以说:仓储跟dao的不同是因为仓储还包括一些业务的逻辑。
老马的一段话:
“A Repository mediates between the domain and data mapping layers, acting like an in-memory domain object collection. Client objects construct query specifications declaratively and submit them to Repository for satisfaction. Objects can be added to and removed from the Repository, as they can from a simple collection of objects, and the mapping code encapsulated by the Repository will carry out the appropriate operations behind the scenes.
Conceptually, a Repository encapsulates the set of objects persisted in a data store and the operations performed over them, providing a more object-oriented view of the persistence layer. Repository also supports the objective of achieving a clean separation and one-way dependency between the domain and data mapping layers.”
----------acting like an in-memory domain object collection.
象一个在内存里的领域对象一样运作着。仓储 就像 内存管理器一样,应该是缓存吧。 可以存放对象,删除对象。是不是可以理解:仓储具有操作对象(CRUD)功能的缓存呢?
各位老师能不能说一下 仓储怎么存放对象?是存到DB里面吗
[该贴被spring7777777于2008-12-11 21:27修改过]
[该贴被spring7777777于2008-12-11 21:30修改过]