Active Record Pattern

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:

    He crafted his writing and loved listening to those tiny explosions when the active brutality of verbs in revolution raced into sweet established nouns to send marching across the page a newly commissioned army of words-on-maneuvers, all decorated in loops, frets, and arrowlike flourishes.
    Alexander Theroux (b. 1940)

    Human beings are compelled to live within a lie, but they can be compelled to do so only because they are in fact capable of living in this way. Therefore not only does the system alienate humanity, but at the same time alienated humanity supports this system as its own involuntary masterplan, as a degenerate image of its own degeneration, as a record of people’s own failure as individuals.
    Václav Havel (b. 1936)

    In almost every marriage there is a selfish and an unselfish partner. A pattern is set up and soon becomes inflexible, of one person always making the demands and one person always giving way.
    Iris Murdoch (b. 1919)