PHP
  Home arrow PHP arrow An Object-Oriented Approach to Lazy and Eager Loading in PHP 5
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

An Object-Oriented Approach to Lazy and Eager Loading in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 2
    2009-09-16


    Table of Contents:
  • An Object-Oriented Approach to Lazy and Eager Loading in PHP 5
  • Review: eager loading in PHP 5
  • Building a basic loader class
  • Using the Loader class in a sample script

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    An Object-Oriented Approach to Lazy and Eager Loading in PHP 5
    ( Page 1 of 4 )

    Welcome to the second installment of a series that shows you how to implement lazy and eager loading in PHP 5. Through a strong hands-on approach, this series teaches you how to use these patterns in some typical scenarios. In this way, you'll grasp their underlying logic and learn quickly how to take advantage of their functionality to speed up your own PHP-based programs.

    Learning how to apply the lazy and eager loading design patterns in PHP 5 can have a huge impact in the performance of your web-based applications, especially if they rely on objects that are used for interacting with one or multiple database tables. Therefore, if you're interested in learning the key concepts that surround the implementation of these powerful behavioral patterns, then don't hesitate anymore and start reading right now!

    And now that you know what to expect from this set of articles, it's time to refresh the topics that were discussed in the previous one. To summarize, in that first part of the series I developed an example to demonstrate how to use eager loading pattern in conjunction with a sample class that stored information about some fictional users through its properties.

    The example was comprised of a single script that included the class at the very beginning of its execution, and created an instance of this class, even when this instance wasn't specifically requested by the program. In programming jargon, this process is commonly known as eager inclusion of a class (or eager loading, naturally). When applied in a clever way, it can help make certain applications run faster.

    However, the example that I just described above used a mixture of procedural and object-oriented code to perform the corresponding eager loading process, which isn't very efficient. Thus, in this second chapter of the series I'm going to modify this example by employing a strict object-oriented approach.

    Now, let's leave the preliminaries behind us and continue learning more about the eager loading pattern in PHP 5. Let's get started!



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

       

    PHP ARTICLES

    - Adding Ordering and Grouping Clauses to the ...
    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek