How TableData gateway differs from Rowdata Gataway?.. need clarification

Viewed 4184

I have recently been reading about,TableData Gateway and RowData Gateway.According to "Patterns of Enterprise Application Architecture" RDG deals with one record at a time and TDG deals with a whole table.But both these patterns look very similar,they encapsulate SQL queries and either return a single record or many records in a recordset based on the queries we make.I cannot really figure out when to prefer TDG for RDG.It would be very helpful to clarify the difference with some explaination.According to Martin Fowler TDG is the same as RDG when it returns one record.But we can also use RDG for multiple records also!then why use TDG. Any help will be appreciated. Thank You.

1 Answers
Related