Hacker News new | ask | show | jobs
by esaym 2589 days ago
Related: The "AnemicDomainModel" https://www.martinfowler.com/bliki/AnemicDomainModel.html

In other words, there should be another layer in-between your DAO (data access object, ORM, etc) and controller. The "Model" in MVC was never meant to represent a single row of a database in object form. A Model should have a DAO but a Model should not be a DAO.

1 comments

The whole point of the Active Record pattern is that domain objects double as DAOs.

https://martinfowler.com/eaaCatalog/activeRecord.html

I agree. Not a fan of Martin Fowler for many reasons but a good ORM is your DAO. Otherwise there's not much a point