Hacker News new | ask | show | jobs
by mumblemumble 1952 days ago
I see that, too. But I don't think it's fair to blame on ORM. I also see it happening in non-ORM code that uses the repository pattern, for example.

For example, there's nothing about the code example you give that strictly implies the use of an ORM, just the use of some sort of layered design.

1 comments

I didn't meant to blame ORM, only highlight the (mis)use of them in this type of scenario - but yes, you are correct. It is an abuse of the repository - ORM or other. :)
Laravel Eloquent permits sparse loading of a model; but the way ORM is used in general, this might be a bug factory. Nevertheless I do use the technique where the objects exist only within the scope of a given subroutine.