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.
精彩评论