What is the difference between the Data Mapper, Table Data Gateway (Gateway), Data Access Object (DAO) and Repository patterns?

Your example terms; DataMapper, DAO, DataTableGateway and Repository, all have a similar purpose (when I use one, I expect to get back a Customer object), but different intent/meaning and resulting implementation. A Repository “acts like a collection, except with more elaborate querying capability” [Evans, Domain Driven Design] and may be considered as an “objects in … Read more