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:

    All is changed. All looks strange to me and gives me a feeling which I would rather get away from, although I know it to be the carrying out of natural laws. And I am not complaining. I am doing the same as many old people have done, I suppose, who have led an active life and suddenly find themselves living without a purpose. Oh, my heart is so full. I could write a big book on the subject of going out of this world gracefully.
    Maria D. Brown (1827–1927)

    One foot in each great ocean
    Is a record stride or stretch.
    Robert Frost (1874–1963)

    The worthiest man to be known, and for a pattern to be presented to the world, he is the man of whom we have most certain knowledge. He hath been declared and enlightened by the most clear-seeing men that ever were; the testimonies we have of him are in faithfulness and sufficiency most admirable.
    Michel de Montaigne (1533–1592)