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.

  1. When to Use

    1. This pattern is obsolete for direct implementation because ORM tools like Entity Frameworks work do this job more effectively.

      1. Generally used with Domain Model or Table Module to connect with data base.

      2. I prefer Table Data Gateway when the result set representation is convenient for the Transaction Script (110) to work with.

  2. Overview Tutorials

  1. Related Patterns

      1. ORM : is preferred method for DB-Domain mapping.

      2. Transaction Scripts : Table Data Gateway is very suitable for Transaction Scripts.

  1. Related Technologies

      1. None

  1. References

      1. None