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:
“Things happen to us, all the time. It was like that for a century, and it is again. Its not like here: People always do things, because you are born with it; you are brought up in this spirit, the active approach to life: Stand up and go. We were not. We were always passive in our lives.”
—Natasha Dudinska (b. c. 1967)
“When our kids are young, many of us rush out to buy a cute little baby book to record the meaningful events of our young childs life...But Ive often thought there should be a second book, one with room to record the moral milestones of our childs lives. There might be space to record dates she first shared or showed compassion or befriended a new student or thought of sending Grandma a get-well card or told the truth despite its cost.”
—Fred G. Gosman (20th century)
“Each child is an adventure into a better lifean opportunity to change the old pattern and make it new.”
—Hubert H. Humphrey (19111978)