Data access layer design pattern
I need to build a data access layer and I am looking for the right design pattern.
what I need is:
- object mapping: it shouldn't be too complicated and not generic.
- I have a lot of loo开发者_如何学Ck up tables and I need to a good way to load them. I don't care about starting time (when the program starts up), what I care is to minimizing the number of connections to the db and on the other hand not killing the virtual memory.
- relationships: I have a lot of connected objects which relate to each other and I need a generic way to load as much as relationships as I want.
Number 2(above) is most critical for me. Any suggestions?
Thanks
It looks like the Facade pattern could be used here.
and maybe the Singleton pattern too.
精彩评论