Do you have a question? Post it now! No Registration Necessary. Now with pictures!
May 4, 2006, 12:26 am
rate this thread
think the last pattern I did was the Singleton in January. Getting
back to it here is my first cut at the Builder pattern.
In the builder pattern a director and builder work togther to build an
object. The director controls the building and specifies any
variations that can be done with the object. The builder knows how to
build the object.
There are a couple things I'm not 100% sure of yet in my example.
I use of a formatPage() function in my HTMLPage.php. I'm not sure if
it should be there or in the builder.
I only have a HTMLPage builder shown, but perhaps to be a complete
example a contrasting XMLPage or RSSPage builder would be helpful.