J2EE Patterns forum J2EE Patterns forum J2EE Patterns forum Messages: 1Messages: 1Messages: 1 Bookmark thread Bookmark thread Bookmark thread Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML
Using DAOs in Design
Posted by: buddy B on November 16, 2004 @ 02:59 PM
I am designing an application for which I am thinking of designing the Data Access using the DAO Pattern.
I have a few questions which if anyone could clarify, I would be grateful.
1. DAOs are used so that the client is loosely coupled with the Persistence layer. So, say at a time, you can have only one type of DB at a time, say Oracle OR Sybase OR Sequel etc. So using Factory Pattern, we can create the corresponding DAO Object on the Fly.
But, in my case, I have to talk to different types of DBs at a time. I mean, the DB which is solely to my new application will be one, say Oracle, but the application talks to a few other systems whose DB may be different.
In such a situation, how DAOs can be effectively used? Anybody could help me in this..?
2. Suppose I have various entities in my application domain , say Customer, Order..say a 10 different items.. So according to DAO pattern, I am going to have 10 different types of DAOs..? Is my understanding correct..?
Expecting the replies asap...
Thanks in Advance...