+1 vote
in Software Architecture by (75.2k points)
The Factory patterns decouple clients from products by taking advantage of interfaces in two ways?

(a) The generator class with the factory methods cannot be changed, disallowing  variability in factory method implementations

(b) Instances of a variety of classes that implement the product interface can be returned by a factory method, allowing great flexibility in results

(c) All of the mentioned

(d) None of the mentioned

I had been asked this question by my school principal while I was bunking the class.

My question comes from The Generator Category, Factory Patterns and Singleton Patterns in division Visibility, Accessibility and Information Hiding of Software Architecture

1 Answer

0 votes
by (46.2k points)
Correct choice is (b) Instances of a variety of classes that implement the product interface can be returned by a factory method, allowing great flexibility in results

Best explanation: Generator class with the factory method can be changed.

Related questions

We welcome you to Carrieradda QnA with open heart. Our small community of enthusiastic learners are very helpful and supportive. Here on this platform you can ask questions and receive answers from other members of the community. We also monitor posted questions and answers periodically to maintain the quality and integrity of the platform. Hope you will join our beautiful community
...