Content deleted Content added
One of these references does not resolve, one is literally a Stack Exchange question, one is some dude's blog, and the O'Reilly link barely has any context. It is not an appropriate comment for the start of the article without. Please see WP:NPOV. It is not "Currently regarded as an anti-pattern", at best you could say it is currently regarded as an anti-pattern _by some_. |
Thanks for your suggestions |
||
Line 1:
In [[software engineering]], the '''active record pattern''' is considered an [[Architectural pattern (computer science)|architectural pattern]] by some people and as an [[anti-pattern]] by some others recently<ref>[https://www.oreilly.com/library/view/sql-antipatterns/9781680500073/f_0159.html Antipattern: The Model Is an Active Record]</ref><ref>[https://www.mehdi-khalili.com/orm-anti-patterns-part-1-active-record ORM anti-patterns - Part 1: Active Record]</ref>. It is found in software that stores in-memory object data in [[relational database]]s. It was named by [[Martin Fowler (software engineer)|Martin Fowler]] in his 2003 book ''Patterns of Enterprise Application Architecture''.<ref>{{cite book |last=Fowler |first=Martin |title=Patterns of enterprise application architecture |publisher=Addison-Wesley |year=2003 |isbn=978-0-321-12742-6 |url=https://books.google.com/books?id=FyWZt5DdvFkC&q=active+record&pg=PT187 }}</ref> 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.
The active record pattern is an approach to accessing data in a [[database]]. A [[database table]] or [[View (database)|view]] is wrapped into a [[class (computer science)|class]]. Thus, an [[object (computer science)|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]] [[Method (computer programming)|methods]] or properties for each column in the table or view.
|