<ddd--領域驅動設計學習>討論--------倉儲

spring7777777發表於2008-12-11
<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修改過]

相關文章