News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Giorgio Sironi's Blog:
Lazy loading of objects from database
July 21, 2009 @ 12:48:54

In recent post to his blog Giorgio Sironi takes a look at a handy feature that PHP makes it relatively simple to work with objects in your applications - lazy loading.

What is lazy loading? A practice in object/relational mapping which simulate the presence of the whole object graph in memory. There is some techniques for produce this illusion that I explain here. [...] The main problem is that we cannot load all the object graph, because it will not fit in the memory of the server and it will take much time to build, depending on the size of the database. Nor we can load an arbitrary subset of it.

His solution is to use the proxy design pattern to create an interface allowing only the first level of information to be loaded by default. After that, each of the sub-levels have what they need to load themselves and the data that might be needed inside.

0 comments voice your opinion now!
tutorial database object load lazy


blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: Bitcoin and PHP with Coinbase’s API – Demo App

PHPit.net: PHP on the command line

YoungCoders.com: The PHP Construct You've Never Used

PseudoCoder.com: How To Really Use Xdebug To Speed Up Your App

Chad Lung's Blog: Install Lighttpd, PHP and MySQL on Ubuntu 10.10


Community Events

Don't see your event here?
Let us know!


api opinion symfony security series library framework extension interview introduction laravel5 voicesoftheelephpant unittest community language version threedevsandamaybe podcast release laravel

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework