1. Home
  2. Computing & Technology
  3. Computer Certification
Correct!

Choice B is correct.

Builder (GOF 97) separates the construction of a complex object from its representation so that the same construction process can create different representations. Here the complex object is a computer. A computer is always made up of exactly one processor, one HDD and one Memory stick (problem description.) However there is no predetermined formula for combining the parts. Hence Builder is the best pattern here and choice B is correct.

Choice A is incorrect because Factory Method (GOF 107) defines an interface for creating an object but lets subclasses decide which class to instantiate. You may use factories of factories to construct a complex object, but by itself, the Factory method is good for creating one out of many. Example: create one processor out of a set of three processors.

Choice C is incorrect because Prototype (GOF 117) specifies the kinds of objects to create using a prototypical instance. Example: Given a processor, if you were asked to create a computer that used multi processors, this would be a good option.

Choice D is incorrect because Abstract Factory (GOF 87) provides an interface for creating a family of related or dependent objects. If the question had defined a relation such as 'A computer of 800 Mhz processor can only be coupled with a 40 GB HDD and 128 MB RAM stick', this would have been an ideal solution.

Choice E is incorrect because Singleton (GOF 127) ensures that a class has only one instance (or a well-defined number of variable instances) and appropriate global pointers are available to the instance(s).


Continue quiz>


Explore Computer Certification
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Computer Certification

©2009 About.com, a part of The New York Times Company.

All rights reserved.