Page 1 of 1
About Question enthuware.ocpjp.v7.2.2003 :
Posted: Thu Sep 26, 2013 3:12 pm
by Student
"The factory pattern is applicable in this case because the application classes do not know which Data access object implementation they should instantiate."
How do we know that to be true, given the information supplied in the question?
Re: About Question enthuware.ocpjp.v7.2.2003 :
Posted: Thu Sep 26, 2013 6:25 pm
by admin
Actually, you don't but that is the whole point of the question. i.e. what should be done for a given situation. The explanation has been modified to say, "The factory pattern is applicable in this case because the application classes should not be made aware of which Data access object implementation class they need to instantiate. "
This should make it more clear.
HTH,
Paul.
Re: About Question enthuware.ocpjp.v7.2.2003 :
Posted: Fri Sep 27, 2013 1:45 pm
by Student
Ok understood, thanks.
Re: About Question enthuware.ocpjp.v7.2.2003 :
Posted: Tue Oct 06, 2015 11:17 am
by pbonito
In this case the factory pattern works only if you're already applied the DAO pattern.
So if I have to choose just one myabe that DAO it's more appropriate.
Re: About Question enthuware.ocpjp.v7.2.2003 :
Posted: Tue Oct 06, 2015 11:25 am
by admin
The problem statement itself says that you plan on having data access objects. It is asking you for a solution for how to deliver to those DAOs. So DAO cannot be the answer.