About Question enthuware.ocpjp.v7.2.2003 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
Student
Posts: 53
Joined: Fri Sep 20, 2013 7:20 am
Contact:

About Question enthuware.ocpjp.v7.2.2003 :

Post 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?

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.2003 :

Post 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.

Student
Posts: 53
Joined: Fri Sep 20, 2013 7:20 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.2003 :

Post by Student »

Ok understood, thanks.

pbonito
Posts: 13
Joined: Sat May 16, 2015 12:38 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.2003 :

Post 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.

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.2003 :

Post 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.

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests