I'm creating a new application that hits a RDBMS. The DB is not all that normalized and I'm not sure if they will be changing the tables later on.
Anyway I'm trying to figure out how to grab/update the data from the tables. What we did in the past was create one "TransactionDB" class that had all the connection info to JDBC, all the SQL, and returned classes modeled off the tables (really just data class, no behaviors). We would use this class to call "getDoctorInfo" which would return an object that contains all the data fields needed for program. We also called an "updateDoctorInfo" method that took the doctor data object and updated the fields.
Is there a better way to do this - any design patters I should look into? Should I separate the DB layer from the app/business layer (have an intermidiate layer that maps the table data into multiple objects?
osubb
Anyway I'm trying to figure out how to grab/update the data from the tables. What we did in the past was create one "TransactionDB" class that had all the connection info to JDBC, all the SQL, and returned classes modeled off the tables (really just data class, no behaviors). We would use this class to call "getDoctorInfo" which would return an object that contains all the data fields needed for program. We also called an "updateDoctorInfo" method that took the doctor data object and updated the fields.
Is there a better way to do this - any design patters I should look into? Should I separate the DB layer from the app/business layer (have an intermidiate layer that maps the table data into multiple objects?
osubb