Active Record, nice and blended
19-Dec-2022 1065
Persisting objects in relational databases is an intricate problem. Two decades ago, it looked like the ultimate orthogonal problem to solve: abstract persistence out so that programmers don’t have to care about it. Many years later, we can affirm that… it’s not that simple. Persistence is indeed a crosscutting concern, but one with many tentacles.Because it can’t be fully abstracted, many patterns aim to isolate database access on its own layer to keep the domain model persistence-free. For example repositories, Data Mappers or DAOs (Data Access Objects). Rails, however, went with a different approach — Active Record — a pattern introduced by Martin Fowler in Patterns of EAA:An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.
Active Record, nice and blended #ruby #rubydeveloper #rubyonrails #Active #Record, #blended #active #record, https://rubyonrails.ba/link/active-record-nice-and-blended