nerdexam
Oracle

1Z0-805 · Question #61

Given: What two changes should you make to apply the DAO pattern to this class?

The correct answer is C. Move the add, delete, find, and update methods into their own implementation class. D. Create an interface that defines the signatures of the add, delete, find and update command. In computer software, a data access object (DAO) is an object that provides an abstract interface to some type of database or persistence mechanism, providing some specific operations without exposing details of the database. It provides a mapping from application calls to the…

Advanced Class Design

Question

Given:

What two changes should you make to apply the DAO pattern to this class?

Exhibits

1Z0-805 question #61 exhibit 1
1Z0-805 question #61 exhibit 2

Options

  • AMake the customer class abstract.
  • BMake the customer class an interface.
  • CMove the add, delete, find, and update methods into their own implementation class.
  • DCreate an interface that defines the signatures of the add, delete, find and update command.
  • EMake the add, delete, find, and update methods private for encapsulation.
  • FMake the getName and getId methods private fir encapsulation.

How the community answered

(32 responses)
  • A
    6% (2)
  • B
    3% (1)
  • C
    81% (26)
  • F
    9% (3)

Explanation

In computer software, a data access object (DAO) is an object that provides an abstract interface to some type of database or persistence mechanism, providing some specific operations without exposing details of the database. It provides a mapping from application calls to the persistence layer. This isolation separates the concerns of what data accesses the application needs, in terms of domain-specific objects and data types (the public interface of the DAO), and how these needs can be satisfied with a specific DBMS, database schema, etc. (the implementation of the In the specific context of the Java programming language, Data Access Objects as a design concept can be implemented in a number of ways. This can range from a fairly simple interface that separates the data access parts from the application logic, to frameworks and commercial

Topics

#DAO pattern#interface design#separation of concerns#class design

Community Discussion

No community discussion yet for this question.

Full 1Z0-805 Practice