The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Timber Lee: Builder Answer Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Architect Certification (SCEA/OCMJEA)
Reply Bookmark "Timber Lee: Builder Answer" Watch "Timber Lee: Builder Answer" New topic
Author

Timber Lee: Builder Answer

Sanjay Raghavan
Ranch Hand

Joined: May 14, 2002
Posts: 148
Timber,
You had sent me a mail with a question on the builder pattern. Because of your privacy settings at the ranch, I am unable to respond to you privately. Further I also figured that this way, others will have an opportunity to participate as well.
The question was to do with an example for the Builder pattern. Builder is a creational GoF pattern. A while back I had posted a detailed description with fast-foods as an example. Please try to read through that. It will give you a clear example of the Builder pattern.
Here's another example. Let us assume that a diagram has to have two objects and some relationship between them.
Given this construct, you can create:
1. Class, Class, Association
2. Interface, Class, Implementation
3. Class, Class, Inheritance and so on.
The idea is that you can only have 2 objects and 1 relationship, but the objects and the relationship can be constructed dynamically Ala Carte.
HTH.


Sanjay Raghavan<br />SCJP2, SCEA-J2EE<br />Moderator - <a href="http://groups.yahoo.com/group/scea_prep" target="_blank" rel="nofollow">SCEA PREP</a><br />Co-Author - <a href="http://www.whizlabs.com/scea/scea.html" target="_blank" rel="nofollow">SCEA@Whiz</a><br /><i>Where did you sip your Java Today?</i>
 
IntelliJ Java IDE
 
subject: Timber Lee: Builder Answer
 
Threads others viewed
A setter that can only be called by framework
Java Design Pattern
Confusion regarding which pattern!
Builder Pattern - Why does it looks like another Creational pattern
Builder Pattern Question
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture