|
|
Builder pattern
A software design pattern, the builder pattern is used to enable the creation of a variety of complex objects from one source object. The source object may consist of a variety of parts that contribute individually to the creation of each complex object through a set of common interface calls of the Abstract Builder class.
An example of a source object could be a list of characters and images in a message that is desired to be encoded. A director object is needed to feed information about the source object to the builder class. The abstract builder class would be a list of interface calls that the director will use like handleCharacter() or handleImage(). Each concrete version of the builder class could implement a method for these calls or just ignore the information if called. An example of a concrete Builder would be enigmaBuilder which might encrypt the text but ignore the images.
In the example above, the main software would create a specific Builder class, enigmaBuilder. This object would be passed to a simple Director object that would iterate through each piece of data in the main message of the source object. The builder class would incrementally create its final project. In the end, the main code will request the final object from the Builder and then destroy both the Builder and the Director. If there was a desire to replace the encryption technique of the enigmaBuilder with another one, a new Builder class could be substituted with little change to the director and main code since the only change would be the actual Builder object that would be given to the Director.
Oftentimes, builder pattern builds Composite pattern, a structure pattern.
Intent: Separate the construction of a complex object from its representation so that the same construction process can create different representations.
See also
This article is licensed under the GNU Free Documentation License at http://www.gnu.org/copyleft/fdl.html You may copy and modify it as long as the entire work (including additions) remains under this license. You must provide a link to http://www.gnu.org/copyleft/fdl.html
To view or edit this article at Wikipedia go to http://www.wikipedia.org/wiki/Builder_pattern
|
©
2005 Music
Entertainment Network. A Cyprus
Roussos Music Entertainment Company. All Rights Reserved.
Articles
from
Wikipedia
Encyclopedia
are licensed under the GNU Free Documentation License. You may copy and
modify it as long as the entire work (including additions) remains under
this license. You must provide a link to http://www.gnu.org/copyleft/fdl.html.
All text is available under the terms of the GNU Free Documentation License.
All trademarks and service marks including Napster,
Rio
MP3 Player, iRock,
Creative
MP3 Player, iRiver,
Apple iPod
Portable
MP3 Players + iTunes,
eMusic,
Guitar
Center Musicians
Friend, Zzounds
Musical Instrument Equipment Store, BMG
Music Service, Columbia
House DVD Club, eBay,
Amazon,
Netflix,
Jamster,
Gamefly,
Friendster,
Music123
Musical Instruments, Billboard,
MTV,
Yahoo
Launch, Overture
Yahoo Search Marketing, MusicMatch,
Kazaa,
Kazaa
Lite, Morpheus
software, Real
Rhapsody, Bose,
Sheet
Music Plus, Billboard
Magazine, Rolling
Stone Magazine, Walmart
Downloads, Barnes
and Noble book store, CDUniverse,
Tower
Records, MSN
Music, MySpace,
Limewire,
WinMX,
Google
Adsense, Alibris,
TicketsNow,
MusicSpace,
uBid
are property of their respective owners. Music.us has no affiliation with
MySpace
or Friendster,
but offers alternative services. Disclaimer: Uploading or downloading
of copyrighted works without permission or authorization of copyright
holders may be illegal and subject to civil or criminal liability and
penalties. Please buy
music and refrain from any illegal downloading activity. User
submitted free content, including Wikipedia encyclopedia or modification
thereof by end users, do not reflect the views and opinions of Music.us
and are for educational and research development purposes. Our website
offers advanced search for bands and artists bio and albums and browse
options for artist band biographies resources and information. We offer
blogs and community building tools for authors, bands and users. The Music.us
Entertainment Network is web's most comprehensive one-stop shopping, community
networking and education site. Find song lyrics, guitar tablature, posters,
ring tones, free MP3 downloads and hourly updating news feeds on musicians
and any genre style including rock,
pop,
hip
hop, country,
christian,
rap,
classical,
folk,
dance,
latin,
R
and B, blues,
punk,
heavy
metal, alternative,
guitar,
bass,
drums,
gospel,
wedding,
arabic,
jazz,
soundtrack,
world,
reggae,
soul
and more. Privacy Policy
- Site Map
- MP3 - Music Downloads
- Song Lyrics
| |