1Z0-804 · Question #111
Given the fragment: Which two valid alternatives to line 3 would decouple this application from a specific implementation of CustomerDAO?
The correct answer is C. CustomerDAO custDao = CustomerDAO.getInstance(); E. CustomerDAO custDao = customerDAOFactory.getInstance(). Note: In software development, the term"decoupling"is used to identify the separation of software blocks thatshouldn't depend on each other. Some building blocks are generic and shouldn't know details of others. Special design techniques allow software designers to have as few…
Question
Given the fragment:
Which two valid alternatives to line 3 would decouple this application from a specific implementation of CustomerDAO?
Exhibit
Options
- ACustomerDAO custDao = CustomerDAO();
- BCustomerDAO custDao = (CustomerDAO) new Object ();
- CCustomerDAO custDao = CustomerDAO.getInstance();
- DCustomerDAO custDao = (CustomerDAO) new CustomerDAOmemoryImp1();
- ECustomerDAO custDao = customerDAOFactory.getInstance();
How the community answered
(18 responses)- B6% (1)
- C83% (15)
- D11% (2)
Explanation
Note: In software development, the term"decoupling"is used to identify the separation of software blocks thatshouldn't depend on each other. Some building blocks are generic and shouldn't know details of others. Special design techniques allow software designers to have as few dependencies as possible. This typicallyreduces the risk of malfunction in one part of a system when the other part changed. It also forces thedeveloper to focus on one thing at a time. Decoupling lowers or minimizes Coupling.
Topics
Community Discussion
No community discussion yet for this question.
