This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Builder Design pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Builder Design pattern" Watch "Builder Design pattern" New topic
Author

Builder Design pattern

aryan sanghvi
Greenhorn

Joined: Jun 13, 2002
Posts: 21
Compact Computers is a small computer assembly company. Their online application allows customers to pick and choose accessories to build their own PCs. The accessories are:

i. Processor - 800Mhz, 1Ghz, 1.2Ghz

ii. HDD - 40 GB, 60 GB, 80 GB

iii. Memory - 128 MB, 256 MB, 512 MB

If a computer can have exactly 1 processor, 1 HDD and 1 memory stick, what pattern would be best used here?

A Factory Method

B Builder

C Prototype

D Abstract Factory

E Singleton

Can somebody please explain why it the answer is Builder ?
thalladi
Greenhorn

Joined: Oct 30, 2005
Posts: 9
I am sure you can understand why it needs to builder if see the example @

http://www.dofactory.com/Patterns/PatternBuilder.aspx

Satheesh
Kiran Ramamoorthy
Greenhorn

Joined: Nov 22, 2005
Posts: 1
We should use the builder pattern here for the following reasons.

a) To separate the construction process of the computer from its representation. This gives us the better control to keep the assembling process separately from the end object type.

b) Because we need to assemble several kinds of computer propreties objects like CPU, Monitor etc but result in a different object type (like ComputerModel based on assembled properties).

Example: http://www.c-sharpcorner.com/Code/2002/Feb/CreationalPatternBuilderAJ.asp

Regards,
Kiran.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Builder Design pattern
 
Similar Threads
Building a computer yourself
Design Pattern: Confusing Questions !! Please help in answering....
Please opine
Builder vs Abstract Factory
Confusion regarding which pattern!