Chapter A.3. Data Mapper and Active Record

As discussed initially in Chapter 8, “RSS, Cookies, and Dynamic Views in WhatWhat Status,” SQLObject follows the Active Record design pattern. In short, this pattern says that each table in your database is represented by a Python class. Instances of those objects directly represent rows in the database table.

The Data Mapper pattern adds an extra layer. There are classes that represent the tables in the database, but there are also objects that separately map from database tables to your classes. The Data Mapper pattern has some advantages over Active Record:

  1. Your classes are ...

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.