nerdexam
Oracle

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…

Object-Oriented Design Principles

Question

Given the fragment:

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

Exhibit

1Z0-804 question #111 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)
  • B
    6% (1)
  • C
    83% (15)
  • D
    11% (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

#DAO pattern#factory method#decoupling#design patterns

Community Discussion

No community discussion yet for this question.

Full 1Z0-804 Practice