Although we can use a dozen different methods to standardize our database functionality, a Database Access Object (or DAO) can be used efficiently to achieve this. This recipe is a working example of how to make your own, and begin organizing your functionality.
Database Access Object (from now on DAO) is used to simplify functionality to and from our database(s). The idea behind a DAO is to create mapping classes that have a single responsibility on their functionality. This means that, for example, we have a table called
cards, which also has a mapping called
Cards mapping will then contain all the functionality we need to use in that table.
This could include, for example, the CRUD (Create, ...