News Feed
Jobs Feed
Sections




News Archive
feed this:

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

DevShed:
Introducing Builder Objects in PHP 5
October 04, 2006 @ 15:03:57

DevShed kicks off another three-parts series today with part one of a look at working with builder objects in PHP5.

In this article, the first of a three-part series, you will be introduced to the basics of creating directors and builder objects with PHP 5. As usual, there will be copious examples to help you quickly start using the builder pattern in your own PHP projects.

Well, to put things in a simple perspective, when the builder pattern is applied, two objects are put into action to create a third one. First, these two objects create a director; as its name suggests, the director controls all aspects of the creation process and determines what pieces and modifications will be introduced into the target object. Finally, a builder is tasked with constructing the third object in question, in accordance with particular specifications. Sounds fairly simple, doesn't it?

They start with a look at starting with the Builder pattern, building a basic XML document to provide the structure for the target object. From that information, they show how to create the object and give a simple class to help direct that object along.

0 comments voice your opinion now!
builder prattern object xml creation director class builder prattern object xml creation director class



Community Events











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


example hack component application security package opinion unittest install introduction overview symfony2 framework podcast code facebook language composer hhvm release

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