AllExam Dumps

DUMPS, FREE DUMPS, VCP5 DUMPS| VMWARE DUMPS, VCP DUMPS, VCP4 DUMPS, VCAP DUMPS, VCDX DUMPS, CISCO DUMPS, CCNA, CCNA DUMPS, CCNP DUMPS, CCIE DUMPS, ITIL, EXIN DUMPS,


READ Free Dumps For Oracle- 1z0-804





Question ID 21437

Given:

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

Option A

Make the Customer class abstract.

Option B

Make the customer class an interface.

Option C

Move the add, delete, find, and update methods into their own implementation class.

Option D

Create an interface that defines the signatures of the add, delete, find, and update methods.

Option E

Make the add, delete, and find, and update methods private for encapsulation.

Option F

Correct Answer: C,D

Explanation:
C:The methods related directly to the entity Customer is moved to a new class.
D: Example (here Customer is the main entity):
public class Customer {
private final String id;
private String contactName;
private String phone;
public void setId(String id) { this.id = id; }

 

Correct Answer F
Explanation


Question ID 21438

Given:

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

Option A

Make the Customer class abstract.

Option B

Make the customer class an interface.

Option C

Move the add, delete, find, and update methods into their own implementation class.

Option D

Create an interface that defines the signatures of the add, delete, find, and update methods.

Option E

Make the add, delete, and find, and update methods private for encapsulation.

Option F

Correct Answer: C,D

Explanation:
C:The methods related directly to the entity Customer is moved to a new class.
D: Example (here Customer is the main entity):
public class Customer {
private final String id;
private String contactName;
private String phone;
public void setId(String id) { this.id = id; }

public String getId() { return this.id; }
public void setContactName(String cn) { this.contactName = cn;} public String getContactName() { return
this.contactName; } public void setPhone(String phone) { this.phone = phone; } public String getPhone() { return
this.phone; }
}
public interface CustomerDAO {
public void addCustomer(Customer c) throws DataAccessException; public Customer getCustomer(String id)
throws DataAccessException; public List getCustomers() throws DataAccessException; public void
removeCustomer(String id) throws DataAccessException; public void modifyCustomer(Customer c) throws
DataAccessException; }
Note: DAO Design Pattern
*Abstracts and encapsulates all access to a data source *Manages the connection to the data source to obtain
and store data *Makes the code independent of the data sources and data vendors (e.g. plain-text, xml, LDAP,
MySQL, Oracle, DB2)

Correct Answer F
Explanation

Send email to admin@getfreedumps for new dumps request!!!