开发者

Approach for decoupling persistence from domain objects?

开发者 https://www.devze.com 2023-01-09 09:59 出处:网络
I understand that it\'s better if objects are not responsible fo开发者_开发问答r their own persistence (makes testing the objects easier, plus separation of responsibilities), but then what object sho

I understand that it's better if objects are not responsible fo开发者_开发问答r their own persistence (makes testing the objects easier, plus separation of responsibilities), but then what object should handle persistence of domain objects, and what should the persistence API look like at a high-level?


The design pattern for persistence ignorance is called a Repository.

There is a fairly good writeup on MSDN.

0

精彩评论

暂无评论...
验证码 换一张
取 消