OAS Talk on the Active Record Design Pattern

On January 26, 2011, I gave a small talk at the 70th meeting of the Oregon Academy of Science. The talk was designed to provide an introduction to the active record design pattern, complete with guidelines for when it is and isn’t appropriate to use, as well as tips for implementing the pattern.

Supplemental materials:

The example is an implementation of the active record pattern modelled for use in a gradebook that needs to manage students, assignments, and grades. The example is implemented with Python and SQLite and is well commented.


The official title of the talk was “Making database access more object-oriented with the active record design pattern”, and here is the (corrected) abstract:

Relational database access in an object-oriented language is often at odds with object-oriented coding style. The active record pattern provides an object that encapsulates row-level database access and domain logic. We discuss the advantages/disadvantages, appropriate application, and implementation concerns of the active record pattern. Using a gradebook web-application as a case study, we find that the active record pattern can help simplify code and provide an intuitive interface for database access.