php - Why does active record pattern not work with rich domain models? -


i'm reading architectural patterns chapter of poeaa, , fowler says "as domain logic gets more complicated , begin moving toward rich domain model (116), simple approach of active record (160) starts break down. one-to-one match of domain classes tables starts fail factor domain logic smaller classes. relational databases don't handle inheritance, becomes difficult use strategies [gang of four] , other neat oo patterns. domain logic gets feisty, want able test without having talk database time."

i didn't understand this. "one 1 match of domain classes tables", mean classes there no associations or single table inheritance hierarchy?

and why factoring domain logic smaller classes cause pattern fail?

what he's trying more complex domain models more "data table". these more complex models fowler talking models data different tables, views or maybe other sources.

the active record pattern not suitable purpose, , datamapper pattern combined model classes (containing business logic , not communicate data access layer) more suitable in situations these.

the active record pattern fails here, because maps more or less directly table in database.

i don't know exact pattern definition, please correct me if i'm wrong.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -