Row data gateway pattern
From CSSEMediaWiki
(Difference between revisions)
m (New page: '' 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...) |
m |
||
Line 5: | Line 5: | ||
= When to use it = | = 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]. | + | 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]]. |
= Example = | = Example = | ||
TBC | TBC |
Revision as of 08:52, 17 October 2010
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.
Example
TBC