In software engineering, the active record pattern is an architectural pattern found in software that stores its data in relational databases. It was named by Martin Fowler in his 2003 book Patterns of Enterprise Application Architecture. The interface of an object conforming to this pattern would include functions such as Insert, Update, and Delete, plus properties that correspond more or less directly to the columns in the underlying database table.
Active record is an approach to accessing data in a database. A database table or view is wrapped into a class. Thus, an object instance is tied to a single row in the table. After creation of an object, a new row is added to the table upon save. Any object loaded gets its information from the database. When an object is updated the corresponding row in the table is also updated. The wrapper class implements accessor methods or properties for each column in the table or view.
This pattern is commonly used by object persistence tools, and in object-relational mapping (ORM). Typically, foreign key relationships will be exposed as an object instance of the appropriate type via a property.
Read more about Active Record Pattern: Implementations
Famous quotes containing the words active, record and/or pattern:
“How often must I repeat, that I know or am conscious of my own being; and that I myself am not my ideas, but somewhat else, a thinking, active principle that perceives, knows, wills, and operates about ideas?”
—George Berkeley (16851753)
“Unlike Boswell, whose Journals record a long and unrewarded search for a self, Johnson possessed a formidable one. His life in Londonhe arrived twenty-five years earlier than Boswellturned out to be a long defense of the values of Augustan humanism against the pressures of other possibilities. In contrast to Boswell, Johnson possesses an identity not because he has gone in search of one, but because of his allegiance to a set of assumptions that he regards as objectively true.”
—Jeffrey Hart (b. 1930)
“It may be tempting to focus on the fact that, even among those who support equality, mens involvement as fathers remains a far distance from what most women want and most children need. Yet it is also important to acknowledge how far and how fast many men have moved towards a pattern that not long ago virtually all men considered anathema.”
—Katherine Gerson (20th century)