Home arrow PHP arrow A Final Example of Late Static Bindings in PHP 5.3

A Final Example of Late Static Bindings in PHP 5.3

Late Static Bindings (LSB), a powerful feature bundled with PHP 5.3, are much easier to master than you might think. Achieving intimate knowledge of them requires only an average background in working with objects and classes. This article concludes a six-part series that shows you what you can do with LSB.

TABLE OF CONTENTS:
  1. A Final Example of Late Static Bindings in PHP 5.3
  2. Review: source code of all sample classes developed so far
  3. Putting the BlockLevelElementFactory class into action
  4. Creating (X)HTML objects in a static context
By: Alejandro Gervasio
Rating: starstarstarstarstar / 2
May 26, 2010

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

So, if you're a developer interested in grasping the key concepts that surround the implementation of LSB, then I recommend you start reading this article series right now. Through its tutorials you'll learn how to take advantage of the functionality offered by LSB to create flexible hierarchies of classes where at least one of their methods will be used in a static context.

Naturally, marketing the numerous benefits provided by LSB is a process that must be complemented in all the cases with some functional and illustrative code. In keeping with this premise, in previous parts of this series I explained how to implement this feature in the construction of a concrete factory class, which thanks to the use of LSB, was provided with the ability to statically create a couple of block-level (X)HTML objects via a static method, not surprisingly called "create()," or at instance level via its pertinent constructor.

In addition, I left off the last article showing the definitions of the classes responsible for originating the aforementioned (X)HTML objects, an easy to follow process. While it's possible to create and manipulate these objects as standalone structures, my goal here is to demonstrate how to bring them to life by using the concrete factory previously defined. In consonance with this, in this last installment of the series I'm going to set up an example that will show how to put all of these classes to work together. This will demonstrate how the clever use of LSB can be of great help when building flexible factory classes.

Ready to learn how this will be done? Then don't waste more time; begin reading!



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

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- 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...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: