[odb-users] Re:Object Loading

Andrew Cunningham andrew at a-cunningham.com
Thu Mar 24 12:21:43 EDT 2016


Hi Boris,
I'm not sure that operator-> caused the OODB movement to falter :).

But the point that I am trying to make is that when 'porting' existing C++
with a complex object graph of relationships code (to ODB), it is very,very
tedious to use lazy loading and have to track down every time an object is
referenced and check its load state.

So in an initial port, one will avoid shared_lazy_ptr, and be using
shared_ptr. Thus we will load 20,000 objects ( or in my case 200,000
objects) by referencing a root object.

My suggestion remains that it would be useful to a subset of users to
provide an additional type of lazy_ptr  that has the 'auto-load' behavior.
You might think it is trivial to write,but not everyone is an expert in
advanced C++ templates, and traits and so forth.  As long as it is not the
default, I don't see the 'harm'' in it , apart from it being additional
work for you to maintain and document.


More information about the odb-users mailing list