开发者

Gateway Patterns

开发者 https://www.devze.com 2023-01-27 01:46 出处:网络
I have a class for example called person and I have a method inside it开发者_JAVA百科 called GetPeople that returns a list of person objects. I doesn\'t necessarily go to a database to retrieve these

I have a class for example called person and I have a method inside it开发者_JAVA百科 called GetPeople that returns a list of person objects. I doesn't necessarily go to a database to retrieve these , it can be xml, but is this the active record pattern. Should this be used or should I use a gateway pattern to retrieve all the person objects? How is this normally done or what is recommended. I don't know if it matters whether I'm getting them from a database or file or xml.


you can look at Repository pattern as well.

0

精彩评论

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

关注公众号