Skip to content

AbstractDbMapper Notes

akrabat edited this page Aug 25, 2012 · 3 revisions
  • It is expected that AbstractDbMapper is extended by a concrete mapper class that then exposes domain specific methods to the application. (e.g. fetchLatest())
  • All methods in AbstractDbMapper should be protected so that the concrete mapper controls what is exposed. This is especially true of any method that takes a select object or a table name.
    • The only methods that are public should be those required to set up the class (e.g. setHydrator).
  • AbstractDbMapper should not leak implementation details to the world. e.g. we don't implement public getTableName(). If this is required, then the concrete class can do it.
  • The methods in AbstractDbMapper should be needed by 90% of all concrete mappers that extend this class.
Clone this wiki locally