Which design pattern best describes the class?

Given:
<code>
public class DAOManager {
public AccountDAO getAccountDAO() {
return new AccountJDBCDAO();
}
}
</code>
Which design pattern best describes the class?

Given:
<code>
public class DAOManager {
public AccountDAO getAccountDAO() {
return new AccountJDBCDAO();
}
}
</code>
Which design pattern best describes the class?

A.
Singleton

B.
DAO

C.
Factory

D.
Composition

Explanation:
Data Access Object
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)



Leave a Reply 3

Your email address will not be published. Required fields are marked *


allansantos

allansantos

This seems like a Factory to me. Letter C.