Java OCA OCP Practice Question 406

Question

Which is a benefit of the DAO pattern?

Choose all that apply.

  • A. Reuse is easier
  • B. The database code is automatically generated
  • C. We can change the database implementation independently
  • D. Your business object extends the DAO pattern to reduce coding
  • E. You are limited to one DAO object


A and C are correct.

Note

The DAO pattern centralizes logic for the data access code, making reuse easier and allowing you to switch out implementations.

B is incorrect because you still have to code the DAO.

D is incorrect because you call a

DAO from your business object; you do not inherit from it.

E is incorrect because you can have many DAO objects.




PreviousNext

Related