Objective 4.8: Identify costs and benefits of using an intermediate data-access object between an entity bean and the data resource

Benefits

  • transparency: specifics of data access are hidden from the bean
  • modular: the DAO could be swapped for another with little disruption to the bean code
  • cleaner code: data access is factored out which simplifies the bean code
  • reusable: DAO could be re-used in a Fast Lane Reader

Costs

  • only suitable for BMP
  • extra code: DAO classes, DAO factories, wrapper calls in the bean
Note:
Do not use DAO with stateful session beans.
Fast Lane Reader
A design pattern providing a more efficient way to access tabular, read-only data.
A fast lane reader component directly accesses persistent data using JDBC components, instead of using entity beans.
Click here for more information on this pattern.

Hall of fame

  • Me: Part I 81%
  • Heros