开发者

Approach for decoupling persistence from domain objects?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜