Which two valid alternatives to line 3 would decouple this application from a specific implementation of CustomerDAO?

Given the fragment: Which two valid alternatives to line 3 would decouple this application
from a specific implementation of CustomerDAO?

Given the fragment: Which two valid alternatives to line 3 would decouple this application
from a specific implementation of CustomerDAO?

A.
CustomerDAO custDao = CustomerDAO.getInstance();

B.
CustomerDAO custDao = (CustomerDAO) new CustomerDAOmemoryImp1();

C.
CustomerDAO custDao = (CustomerDAO) new Object ();

D.
CustomerDAO custDao = CustomerDAO();

E.
CustomerDAO custDao = customerDAOFactory.getInstance();



Leave a Reply 5

Your email address will not be published. Required fields are marked *


dwin

dwin

Why B is incorrect?

Vasily

Vasily

Because in this case there is the dependence of specific implementation – CustomerDAOMemoryImpl1. The correct answer is A, E

chia

chia

answer is b and e

baecause CustomerDAOMemoryImpl1 has implemented CustomerDAO

link homepage

link homepage

I’m really loving the theme/design of your blog. Do you ever run into any internet browser compatibility problems? A small number of my blog readers have complained about my blog not operating correctly in Explorer but looks great in Safari. Do you have any advice to help fix this issue?|

Continue

Continue

I quite like looking through a post that will make people think. Also, many thanks for allowing me to comment!|