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