I'm trying to figure out the best way to go about developing an application that relies on 2 different datasources. One is mysql and the other is oracle. Currently i have a class, UserDAO that has the following methods:
I'm not fond of this structure. I have them grouped together because the information each method retrieves is related to a User, yet they connect to 2 different databases. Chances are there will be a need to call getShipToList() from getUserInfo().
My question is, what is the best way of going about this? Do i leave it the way it is, or do i do something like create 2 separate classes like MysqlUserDAO and OracleUserDAO and then have a UserDAO that figures out where to go for the data i'm looking for?
Any suggestions would be most appreciated.
Code:
getUserInfo() - gets info from mysql
getShipToList() - gets info from oracle
I'm not fond of this structure. I have them grouped together because the information each method retrieves is related to a User, yet they connect to 2 different databases. Chances are there will be a need to call getShipToList() from getUserInfo().
My question is, what is the best way of going about this? Do i leave it the way it is, or do i do something like create 2 separate classes like MysqlUserDAO and OracleUserDAO and then have a UserDAO that figures out where to go for the data i'm looking for?
Any suggestions would be most appreciated.