Basically getting ready for the OCPJP 7, I came across this topic "DAO Pattern" Database Access Pattern.
I understand that it uses the Abstract Factory Pattern in order to instantiate as many DAO object as needed (as many the database implementation requires).
However what about the JDBC connection?
Am I suppose to open and close a connection for each Factory method?(insert, update, delete, create)?
How would you proceed?
Although this design pattern is equally applicable to most programming languages, most types of software with persistence needs, and most types of databases, it is traditionally associated with Java EE applications and with relational databases accessed via the JDBC API because of its origin in Sun Microsystems' best practice guidelines ("Core J2EE Patterns") for that platform.
William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.