Row data gateway pattern

From CSSEMediaWiki
Revision as of 21:26, 17 October 2010 by James Ashford (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

An object that acts as a Gateway to a single record in a data source. There is one instance per row.

How it works

Each row in the table is represented as one object. That object has exactly the same fields as the database row, and all the methods to update itself in the database. There is a Finder class which instantiates the object.

When to use it

If you require a slightly higher level of abstraction than the simple Table data gateway pattern, then use it. Fowler uses it most often when using the Transaction script pattern.



Personal tools