About Question enthuware.ocpjp.v7.2.1189 :
Posted: Tue May 05, 2015 8:07 am
related with the question enthuware.ocpjp.v7.2.1126 :
?
If yes, why it is a Factory pattern then?
If no, what's the difference?
Thanks in advance.
andThe basic idea of the DAO pattern is that the code required to create, read, update, and delete (aka CRUD) an object from a data store is separated out from the object itself.
isn't it look similar to:Code: Select all
public Student getStudent(int id) // create an object public void createStudent(Student s) public void updateStudent(Student s) // update an object public void deleteStudent(int id)
Code: Select all
Connection c = DriverManager.getConnection("db url"); // => create an object
c.setAutoCommit(true); // => update the object
If yes, why it is a Factory pattern then?
If no, what's the difference?
Thanks in advance.