473,770 Members | 6,322 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The Builder Design Pattern using PHP5

Last fall I started a series of design pattern examples using PHP5. I
think the last pattern I did was the Singleton in January. Getting
back to it here is my first cut at the Builder pattern.

http://www.fluffycat.com/PHP-Design-Patterns-Builder/

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.
May 4 '06 #1
0 1719

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3489
by: qazmlp | last post by:
Builder pattern seem to suit my requirements perfectly except in one case as described below. I have used the same example diagram that is used in GOF Design pattern book, to explain the problem that I am facing. aClient aDirector aConcreteBuilder =============================================================================
0
3112
by: Xproblem | last post by:
FTP Client Engine for C/C++ 2.4 Screenshot - Soft.comFTP Client Engine for C/C++ 2.4. ... System Requirements: Windows C/C++ compiler - Microsoft operating system: Windows 95, Windows 98, Windows ME, ... www.soft30.com/screen-70-11625.htm - 31k - Cached - Similar pages C++ Server Pages 1.6 - Soft.comC++ Server Pages (CSP) allows developers to build Dynamic Web Pages and Web ... Existing C++ projects can be ported to the Web by simply...
11
4309
by: FluffyCat | last post by:
In Febraury - April of 2002 I put together in Java examples of all 23 of the classic "Gang Of Four" design patterns for my website. Partly I wanted to get a better understanding of those patterns. They are still online at http://www.fluffycat.com/java/patterns.html Since September 2003 I've mainly been using PHP, and now that PHP 5 is becoming more available I am going to try the same thing I did in Java with PHP.
2
7370
by: Mike Turco | last post by:
I like using the expression builder for a lot of different things but it isn't always available when I want to use it, for example in the code window, or in all of the control properties. I am usually stuck having to go into the database window, creating a new query, etc., and then right-clicking in a field and selecting build. Is there a shortcut key, a way to add a button to an Access toolbar, or something like that so I can use to...
4
2626
by: Jason | last post by:
Hi I really need an example of a builder pattern in python, the closest I could find to something resembling builder was on this thread... http://groups.google.co.uk/group/it.comp.lang.python/browse_thread/thread/44f79c1def2583ca/200adefeefa5f3fa?lnk=st&q=design+pattern+builder+python+-build&rnum=25#200adefeefa5f3fa Unfortunately I can't read the discussion it's possibly in Spanish. Does anyone know of a builder example for python?...
2
2301
by: Mike | last post by:
Hello NG, i am just learning various Design Patterns and now i am not sure, if this design is correct (Builder) or if i should use an other pattern. I have various classes (here ChildA and ChildB) derived from class Base. Now i want to create an object, but i don't want to know which class to instantiate.
22
4745
by: Krivenok Dmitry | last post by:
Hello All! I am trying to implement my own Design Patterns Library. I have read the following documentation about Observer Pattern: 1) Design Patterns by GoF Classic description of Observer. Also describes implementation via ChangeManager (Mediator + Singleton) 2) Pattern hatching by John Vlissides Describes Observer's implementation via Visitor Design Pattern. 3) Design Patterns Explained by Alan Shalloway and James Trott
3
2457
by: FluffyCat | last post by:
Last month I continued my series of design patterns examples using PHP 5 with the Observer Pattern and the Prototype Pattern. Here now is my 16th example, the Adapter pattern. http://www.fluffycat.com/PHP-Design-Patterns/Adapter/ In the Adapter Pattern we adapt a class we have to provide methods another class needs, without changing the original class. If you work with a lot of classes that you can not change, then this
1
1748
by: David Bellot | last post by:
Hi, if I consider the Factory Method design pattern, then I should have the following objects: Object and ObjectFactory which are usually abstract classes Then for each subclasses like ConcreteObject1, ConcreteObject2, .... I must have a ConcreteObjectFactory1, ConcreteObjectFactory1, ...
0
9591
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10225
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10001
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9867
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3969
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3573
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.