开发者

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

开发者 https://www.devze.com 2023-01-21 11:29 出处:网络
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 somethi

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

精彩评论

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

关注公众号