jeudi 18 février 2016

What Database Abstraction Patterns Are There?

I am trying to get my head around the common patterns for database abstraction.

So far I've found:

  1. Database Layer
    • just a separate class which holds the SQL
    • does not conform to any other rules
  2. Data Access Object (DAO)
    • like above but there is a transfer object which represents the columns of the database table
    • create, delete, update methods take the filled transfer object as input
    • the find methods may take an input like string (findByName) or an integer (findByAge) but always return lists of transfer objects
  3. Repository
    • abstraction of a collection of objects
    • closer to the domain model
    • I need to read more here
  4. Object Relational Mapper
    • tool which gives me an object which is mapped to the database table in the background
    • the object represents a row in the table
    • a property change of the object leads to an update

Please don't worry too much about my quick explanations of the patters. I am still in an understanding phase.

But is this list complete or are there other concepts which are missing here?

Aucun commentaire:

Enregistrer un commentaire