A repository pattern can be used to encapsulate data storage specific code in designated components. The part of your application, that needs the data will only work with the repositories. You will want to create a repository for each combination of item you store and your database technology.
Read...