Which one of the following is not a participant in Builder pattern?

  1. Builder

  2. ConcreteBuilder

  3. Producer

  4. Product


Correct Option: C
Explanation:

To solve this question, the user needs to know about the Builder pattern and its participants.

The Builder pattern is a design pattern that separates the construction of a complex object from its representation, allowing the same construction process to create various representations. The Builder pattern involves the following participants:

A. Builder: This participant defines an interface for creating objects.

B. ConcreteBuilder: This participant provides an implementation of the Builder interface.

C. Director: This participant constructs complex objects using the Builder interface.

D. Product: This participant represents the complex object being built.

Now, let's go through each option and explain why it is right or wrong:

A. Builder: This option is correct. The Builder participant is one of the four participants in the Builder pattern. Its role is to define an interface for creating objects.

B. ConcreteBuilder: This option is correct. The ConcreteBuilder participant is one of the four participants in the Builder pattern. Its role is to provide an implementation of the Builder interface.

C. Producer: This option is incorrect. The Producer is not a participant in the Builder pattern. It is not related to the construction of objects.

D. Product: This option is correct. The Product participant is one of the four participants in the Builder pattern. Its role is to represent the complex object being built.

The Answer is: C

Find more quizzes: