c.Table Data Gateway Pattern

  1. Motivation
    1. To decouple SQL statement from business objects.
  2. Summary
    1. It is an object that acts as a Gateway to a database table. One instance handles all the rows in the table.

  3. When to Use
    1. This pattern is obsolete for direct implementation because ORM tools like Entity Frameworks work do this job more effectively. 
    2. Generally used with Domain Model or Table Module to connect with data base.
    3. I prefer Table Data Gateway when the result set representation is convenient for the Transaction Script (110) to work with.
  4. Overview Tutorials
    1. http://www.longacre-scm.com/blog/index.php/2006/02/design-pattern-table-data-gateway
  5. Related Patterns
    1. ORM : is preferred method for DB-Domain mapping.
    2. Transaction Scripts : Table Data Gateway is very suitable for Transaction Scripts.
  6. Related Technologies 
    1. None
  7. References
    1. None