Active Record pattern
E440627
The Active Record pattern is a software design pattern in which objects wrap database rows, combining data access and business logic within the same class.
Observed surface forms (2)
| Surface form | Occurrences |
|---|---|
| Active Record | 1 |
| Eloquent ORM | 1 |
Statements (51)
| Predicate | Object |
|---|---|
| instanceOf |
architectural pattern
ⓘ
software design pattern ⓘ |
| commonIn |
.NET ORMs that follow Active Record style
ⓘ
PHP web frameworks ⓘ Ruby on Rails applications ⓘ |
| contrastedWith |
Data Mapper pattern
ⓘ
Repository pattern ⓘ |
| defines | one object per database row ⓘ |
| describedIn | Patterns of Enterprise Application Architecture NERFINISHED ⓘ |
| encapsulates |
business logic
ⓘ
data access logic ⓘ database table row ⓘ |
| hasAuthor | Martin Fowler NERFINISHED ⓘ |
| hasCharacteristic |
attributes map to table columns
ⓘ
class typically maps to a database table ⓘ each Active Record instance corresponds to a single database row ⓘ methods implement domain logic ⓘ methods implement persistence operations ⓘ simple to understand and implement ⓘ tightly couples domain model to database schema ⓘ well suited for CRUD-centric applications ⓘ |
| hasLimitation |
can lead to anemic domain model if misused
ⓘ
harder to test in isolation from the database ⓘ less suitable for complex domain models ⓘ |
| hasPublicationYear | 2002 ⓘ |
| influenced |
CakePHP ORM
NERFINISHED
ⓘ
CodeIgniter Active Record NERFINISHED ⓘ Laravel Eloquent ORM NERFINISHED ⓘ Ruby on Rails Active Record NERFINISHED ⓘ |
| primaryDomain |
enterprise application architecture
ⓘ
object-relational mapping ⓘ |
| relatedConcept |
domain model pattern
ⓘ
object-relational impedance mismatch ⓘ transaction script pattern ⓘ |
| supports |
encapsulation of lifecycle callbacks
ⓘ
encapsulation of validation rules ⓘ simple query interfaces ⓘ |
| typicalMethodName |
create
ⓘ
destroy ⓘ findById ⓘ save ⓘ update ⓘ |
| typicalOperation |
delete
ⓘ
find ⓘ insert ⓘ update ⓘ validation ⓘ |
| usedFor |
combining data access and business logic
ⓘ
encapsulating persistence logic ⓘ mapping database rows to objects ⓘ simplifying CRUD operations ⓘ |
Referenced by (3)
Full triples — surface form annotated when it differs from this entity's canonical label.
this entity surface form:
Active Record