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:

    If church prelates, past or present, had even an inkling of physiology they’d realise that what they term this inner ugliness creates and nourishes the hearing ear, the seeing eye, the active mind, and energetic body of man and woman, in the same way that dirt and dung at the roots give the plant its delicate leaves and the full-blown rose.
    Sean O’Casey (1884–1964)

    Yesterday the Electoral Commission decided not to go behind the papers filed with the Vice-President in the case of Florida.... I read the arguments in the Congressional Record and can’t see how lawyers can differ on the question. But the decision is by a strictly party vote—eight Republicans against seven Democrats! It shows the strength of party ties.
    Rutherford Birchard Hayes (1822–1893)

    Every child has an inner timetable for growth—a pattern unique to him. . . . Growth is not steady, forward, upward progression. It is instead a switchback trail; three steps forward, two back, one around the bushes, and a few simply standing, before another forward leap.
    Dorothy Corkville Briggs (20th century)