[odb-users] Re:Problem with object loading view
boris at codesynthesis.com
Thu Mar 24 03:27:54 EDT 2016
Andrew Cunningham <odb at a-cunningham.com> writes:
> Every C++ OODB I am familiar with uses that "pattern" where an object is
> loaded automatically by the use of the -> or (*) operators.
Maybe that's the reason why they never took off ;-)?
> I think what Marcel was saying was that having to manually manage the
> load'ing of lazy_ptrs is fine for simple examples, but for a complex
> C++ object model it just becomes too much of a burden. Using -> to
> load means you really have no idea when the object is loaded, and
> that's a good thing!
I would disagree, but then ODB is flexible enough to allow you to
implement this semantics if you so desire. We definitely cannot
make it the default since the loading can happen only within a
To elaborate a bit more in why I disagree: A lot of people got burnt
by Hibernate for exactly this reason: to much magic happens behind
the scenes which is nice initialy, as in "I don't need to think
how/when things are loaded", but later you end up with surprises
like "Why on earth this simple call takes 10 minutes? Turns out it
loads 20,000 other objects, for some reason!".
More information about the odb-users