Multiple choice technology programming languages

Compact Computers is a small computer assembly company. Any customer currently has the following choices for a PC: (i) 800 MHz processor, 40 GB HDD, 128 MB RAM (ii) 1 GHz processor, 60 GB HDD, 256 MB RAM (iii) 1.2 GHz processor, 80 GB HDD, 512 MB RAM The use of what design pattern would ensure that only the legal combinations could be sold?

  1. Factory Method

  2. Builder

  3. Prototype

  4. Abstract Factory

  5. Singleton

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Abstract Factory provides an interface for creating families of related or dependent objects (like the legal combinations of processor, HDD, and RAM) without specifying their concrete classes. This ensures only legal combinations are constructed. Other patterns like Builder or Prototype do not inherently enforce family consistency constraints.