File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Builder Design pattern