"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?
About Question enthuware.ocpjp.v7.2.2003 :
Moderator: admin
-
- Posts: 53
- Joined: Fri Sep 20, 2013 7:20 am
- Contact:
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.2003 :
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.
This should make it more clear.
HTH,
Paul.
-
- Posts: 53
- Joined: Fri Sep 20, 2013 7:20 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.2003 :
Ok understood, thanks.
-
- Posts: 13
- Joined: Sat May 16, 2015 12:38 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.2003 :
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.
So if I have to choose just one myabe that DAO it's more appropriate.
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.2003 :
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.
Who is online
Users browsing this forum: No registered users and 37 guests