CS FundamentalsVery hardGATE CS · TCS NQT Prime · Product Company SDE

A UI toolkit must produce whole FAMILIES of related objects (e.g. matching Button, Checkbox and Scrollbar for either a 'dark theme' or 'light theme') that must stay consistent with each other. Which pattern specifically addresses creating families of related objects, as opposed to Factory Method's single-product focus?

  1. A. Abstract Factory pattern
  2. B. Factory Method pattern (it is identical to Abstract Factory)
  3. C. Decorator pattern
  4. D. Builder pattern

Correct answer: A. Abstract Factory pattern

Abstract Factory provides an interface for creating entire families of related objects (several product types that must be used together) without specifying their concrete classes, which Factory Method (a single overridden creation method) does not address on its own.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic