Jump to content

Factory DAO Framework Pattern


Recommended Posts

Hey everybody,I'm trying to decide whether to implement a fully developed DAO framework which consists of the following classes:1. DAO (Like the 'big' one, with the general methods that all other DAOs will use)2. An AbstractFactoryDAO which decides which instance of DAO to start (if mysql DAO or mssql DAO, xml DAO, or any other)3. <ValueObject>DAO (the DAOs that the app needs, like personDAO, studentDAO, etc.)4. A connectionDAO (to establish the connection with the DB)So as I understand the systems engineer that's working with me on this one, the first thing is to start class No. 2, as to invoque the 'mother' that's going to be able to return the exact DAO that I need, so that I can use its methods or services...like getStudents or whatever...But (I'm an informatics engineer with a little knowledge about sw development) I''ve done app with just a 'package' named DAO, where I place a <ValueObject>DAO class for every table that I have in the DB, and a 'mother' class that has a conection to the DB, from whom every other DAO inherits the connetion, and that's it...No abstractFactoryDAOs or anything, just the DAOs, representing the tables in the DB, that connect to it through stored procedures and there you go!I'm not sure if I explained myself enough, but my question is if the factoryDAO way to do it is like a best practice or something, or will a gain any value by making this additional classes. Or if I should just leave it as I know it...it's a web based java app with mysql, and that's it. I'm probably not gonna need to change DB engine in the future for I've been careful selecting it.....I appreciate any opinions!!!Thank you guys!!!!

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...