Skip to main content

Active Record Pattern

Learn Active Record Pattern (Data Access Patterns, Enterprise Design Patterns) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

What is the Active Record Pattern? An Active Record object wraps a single row of a database table AND encapsulates the database-access logic (save, delete, find) inside that SAME class. Unlike Data Mapper, the domain object here is fully aware it's persisted - it knows how to save/load/delete itself.

More lessons in Data Access Patterns