开发者

POCO's - Are they associated with a specific Design Pattern (or patterns)?

Just wondering if the use of POCO's is associated with a particular des开发者_C百科ign pattern.


I think that POCOs and POJOs are examples of the Single Responsibility Principle (principles are something like design patterns but more general). Say Person POCO can have one reponsibility: storing person data, but for example, if we add persistence to POCO, it won't be POCO any more, and will have 2 responsibilities: storing person data and persisting it.


POCOs are usually mentioned in the context of persistence ignorance. It can be used to implement the Unit Of Work pattern.

  • The Unit Of Work Pattern And Persistence Ignorance by Jeremy Miller
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜