In fact, I would not call the DAO a "template". As I see it, the DAO is pretty much what it is - a โdata access objectโ that encapsulates the details of access to a persistent data store and, generally speaking, has nothing to do with the database:
interface IBlogDaoService { Blog GetBlog(long id); void SaveBlog(Blog blog); }
It is clear that implementations can use either a database (in this case it is quite logical to use a Data Mapper) or a simple mechanism for storing XML files.
On the other hand, the Data Mapper is rather a template that defines the level responsible for translating graphs of objects in memory into a relational structure.
source share