design patterns - What's the difference between DAO and Data Mapper -


Is there any difference between DAO patterns and data mapper patterns? Is DAO just one of the data mapper?

I will not actually call "pattern" as a DAO as I see it, the DAO is too much - This is a data access object, which presents details of access to a continuous data store, and generally speaking does not have to do with the database:

  Interface IBlogDaoService {Blog GetBlog (long id), zero service blog (blog blog);}  

It is clear that the implementation is either DB (in that case it is quite rational to use data mapper), or the simple XML file storage system.

On the other hand, Data Mapper is more of a pattern, which defines the responsible layer for translating the in-memory graph of objects into a relational structure.


Comments