Quote Originally Posted by allspiritseve
I would much rather specify defaults that I can override at runtime if necessary. For instance, in your example, I would set up my UserMapper to batch lazy load Posts. Thus, if I'm grabbing multiple users and then running them through a foreach, the first access on a User's associatied Posts collection would call a query to fetch all posts for all users originally requested. Each of these posts would probably have eager loaded comments and tags, and these objects would be ready to use. I'm sure you can imagine other related objects being lazy loaded at this point (and when they are loaded, others being lazy/eager/batch loaded, etc.) and all this can happen with that one line of code I showed you before. No work needed on your part. If my database were as simple as yours, I would get away with one query for each relation on my User object-- thus totalling 6 queries which is totally manageable.
Something that needs to be strategically planned out where as I'm much more interested in being able to make these decisions at run time. The big difference seems to relying on strategy vs. a more agile development approach which is what I'm after. A ORM seems to support the ladder while yielding more responsibility on the developer, while a ActiveRecord supports a more agile approach.