Home arrow PHP arrow Lazy and Eager Loading with Object Properties

Lazy and Eager Loading with Object Properties

Welcome to the fourth chapter of this series on implementing lazy and eager loading in PHP 5. In five friendly tutorials, this series walks you through the basics of using these powerful approaches for including classes on request in your scripts, and teaches you how to work with these patterns when manipulating properties of a certain class.

TABLE OF CONTENTS:
  1. Lazy and Eager Loading with Object Properties
  2. Review: using the lazy loader pattern with PHP 5
  3. Simple eager loading: examining the user class
  4. Applying eager loading to an instance of the User class
By: Alejandro Gervasio
Rating: starstarstarstarstar / 1
September 23, 2009

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Without a doubt, grasping the key concepts that surround the implementation of the lazy and eager loading design patterns in PHP 5 can be of great help when it comes to developing web-based applications that handle their resources in a truly efficient way.

So, if you’re a PHP programmer who wants to expand your existing skills by learning how to apply the aforementioned patterns in some concrete cases, then don’t look any further, because you’ve come to the right place.

And now that you’re aware of the objective of this group of tutorials, it’s time to review briefly the concepts that were deployed in the previous article. In that installment of this series I demonstrated how to take advantage of the functionality given by lazy loading to include a basic class only when a script really required it. Not earlier, and not later neither.

This was accomplished thanks to the development of a resource-loader module, which exploited the nifty autoloading capabilities offered by PHP 5 to include the mentioned class on demand.

However, as I stated in earlier chapters of the series, lazy and eager loading can be used in multiple scenarios and situations, naturally with different results. So, in this fourth episode I’m going to explain how to utilize the eager loading pattern when handling the properties declared by the same “User” class that you learned in the previous tutorial.

Want to find out how this will be achieved in a few simple steps? Then begin reading right now!



 
 
>>> More PHP Articles          >>> More By Alejandro Gervasio
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 6 - Follow our Sitemap

Dev Shed Tutorial Topics: