News Feed
Sections




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

DevShed:
Overloading and Object-Oriented Programming with PHP 5
October 12, 2006 @ 16:03:13

Continuing on with their series pulling from the great book from George Schlossnagle, "Advanced PHP Programming", DevShed has posted this new tutorial looking at the use of overloading with object oriented programming in your PHP 5 scripting expeditions.

Last week, we discussed design patterns and polymorphism. This week, we examine overloading and more. Let's bring together some of the techniques developed so far in this chapter and use overloading to provide a more OO-style interface to the result set. Having all the results in a single object may be a familiar paradigm to programmers who are used to using Java's JDBC database connectivity layer.

The first page shows (mostly in code) how to grab the information from the database and pull it all into the single, tidy result set. They dump this new data packet into the hands of the SPL and iterate through it, pulling out the key/value pairs along the way.

Finally, they look at two of the special functions PHP has to make life a little easier when working with objects - __call and __autoload. Both provide some of that great "automagical" functionality that makes life better.

0 comments voice your opinion now!
object oriented book excerpt advanced overloading php5 object oriented book excerpt advanced overloading php5


blog comments powered by Disqus

Similar Posts

ONLamp.com: Important PHP 5.3 Changes for those of you Running Microsoft Windows

International PHP Magazine: Poll: Which is the Best Tip for Creating a Web Application in PHP?

Zend Developer Zone: Book Review: Object-Oriented Programming with PHP5

DevShed: Parsing Child Nodes with the DOM XML extension in PHP 5

Lukas Smith's Blog: PHP 5.3 alpha1 release imminent


Community Events





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


laravel library language community framework api developer bugfix code podcast threedevsandamaybe interview configure release project wordpress series list application introduction

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