3 ms·
Active Record should be considered an anti-pattern and is definitely in violation of single responsibility at the least. Myself, I wouldn't even put any busine
by spdionis 8y ago
Active Record should be considered an anti-pattern and is definitely in violation of single responsibility at the least.
Myself, I wouldn't even put any business logic in the User object, except maybe representational logic (e.g. have a couple of helper methods that return multiple representation of the same piece of data).
One of the best things to do is separate behavior from data in the first place, which feels kind anti-OO philosophy, but is definitely easier to reason about and work with.