[storm] Fwd: Lazy loading?
James Henstridge
james at jamesh.id.au
Fri Sep 18 10:26:55 BST 2009
On Fri, Sep 18, 2009 at 4:00 PM, peter websdell
<flyingdeckchair at googlemail.com> wrote:
> Thanks James,
> I'm surprised there isn't a trick - perhaps something that can be added in
> the class definition - where I can force the object to load with the
> reference, for situations where I'll be loading large numbers of rows, all
> of which will require access to the related table. I'd seen the option to
> load multiple objects in the tutorial, but it's a bit messy compared to
> simply accessing the Reference of an object.
> It seems to be a pretty typical feature in other ORMs (mainly php) that I
> have used.
> I will continue to investigate.
If you could give some more concrete examples of what you want to do,
and/or links to documentation about the other ORMs you're talking
about, that would be helpful.
In general, I've found multi table find() calls to be quite useful,
especially when you need to control the type of joins being used. The
one area where it can be a bit problematic is if you're passing a
result to a template library that expects a sequence of plain objects.
A simple generator can be used to fix that impedance in most cases,
but it might be worth adding a way to have Storm do it for you.
James.
More information about the storm
mailing list