Home
Core Java
Java
JDBC
Servlets
JSP
EJB
JMS
Struts
Spring
Hibernate
JSF
RMI
CORBA
J2ME
Performance
Tomcat
Weblogic
Design Patterns
Junit
XML
UML
DB2 & SQL
ANT
Free Gift
Contact Us

XML RSS
What is this?
Add to My Yahoo!
Add to My MSN
Add to Google
 

J2EE Pattern

Data Access Object Pattern

Your Ad Here

Creational patterns Structural patterns Behavioral pattern J2EE patterns
Abstract Factory Adapter  Chain of Responsibility
MVC 
Builder Bridge  Command  Business Delegate
Factory method Composite  Interpreter  Composite Entity
Prototype Decorator  Iterator  Data Access Object
Singleton Façade
Mediator  Front Controller

Flyweight  Memento  Intercepting Filter

Proxy  Observer  Service Locator


State  Transfer Object


Strategy 


Template Method



Visitor 

Data Access Object Pattern



Define data access object pattern
Adapt a uniform interface to access multiple databases like relational, unrelational, object-oriented, etc.

Where to use & benefits
Need to access multiple data sources like legacy systems, B2B, LDAP, and so forth.
Lack of uniform APIs to address the requirements to access disparate systems.
Persistent storage APIs vary depending on the product vendor.
Adapt and encapsulate all access to the data source.
Hide the data source implementation details from its clients.
More portable and less code dependencies in components.
Solve differences in the APIs which is used to access different persistent storage mechanisms.
Not useful for container-managed persistence.

Related patterns include
  • factory method -- used to deal with different data sources.
  • abstract factory -- used to make an abstract layer of access to data sources.
  • transfer object -- used to transport data to and from its clients.

Example of Data access object pattern
See sun's code sample

Your Ad Here




footer for Data Access Object Pattern page