Home arrow PHP arrow Developing a Form Director Class

Developing a Form Director Class

Are you interested in expanding your knowledge of creational design patterns and learning how to work with director and builder objects in PHP 5? If your answer is yes, then I think you should start reading this article right now! Welcome to the concluding part of the series “How to Use Builder Objects in PHP 5.” This series leads you through the application of the builder pattern in PHP, and shows you how to use it with copious hands-on examples.

  1. Developing a Form Director Class
  2. Refreshing some core concepts
  3. The form builder class
  4. Defining a form director class
By: Alejandro Gervasio
Rating: starstarstarstarstar / 5
October 18, 2006

print this article




When it comes to using creational patterns with PHP, undoubtedly the builder pattern is one of the most understandable, since the logic that stands behind its application is fairly easy to grasp. On the one hand you have a target object, which needs to be programmatically created, while on the other one you count on two objects, called "director" and "builder" respectively, that control the entire creation process.

In this situation, the director instructs the builder as to what pieces and parts should be included in the target object, a process that is usually performed by injecting the builder directly into the director's constructor. Of course, this definition can be extended beyond this bunch of buzzwords, and used in the context of a real world application, which helps in understanding how this pattern works.

Keeping in mind this practical approach, during the previous article I showed you how to use a few form element objects, along with a form builder class, to create online forms. However, as you'll possibly recall, the implementation of the builder pattern was rather incomplete because the respective form director class remained undefined, a fact that I plan to fix quickly over the course of this last tutorial.

As I expressed above, in this article I'll complete the builder pattern, since I'll demonstrate how to define and use a form director class, in this way putting the final strokes on the example that you learned in the previous tutorial.

With the preliminaries out of our way, let's find out together how to create a form director class!

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

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- 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: