views:

73

answers:

2

hi,

I need to build a data access layer and I am looking for the right design pattern.

what I need is:

  1. object mapping: it shouldn't be too complicated and not generic.
  2. i have a lot of lookup 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.
  3. 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.

any ideas? Focus on number 2 as it is the most critical.

thenx

A: 

My thoughts for focus no 2

If your are having lot of Look Up tables and you think that these tables do not change frequently , Use caching to store this data and remember caching works great as closer to the Presentation layer.

saurabh
While good advice, it sounds to me like the OP hasn't yet gotten a basic design for reading the data out of the DB, in which case caching is premature.
atk
A: 

It looks like the Facade pattern could be used here.

and maybe the Singleton pattern too.

Attilah