SOFTWARE ENGINEERING

SOFTWARE DESIGN

DESIGN PATTERNS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which text below describes the Factory Method Pattern best?
A
Encapsulates interchangeable behaviours and uses delegation to decide which one to use.
B
Separates the construction of a complex object from its representation.
C
Subclasses decide which concrete classes to create.
D
Changes the interface of one or more classes.
E
Simplifies the interface of a group of classes.
Explanation: 

Detailed explanation-1: -In class-based programming, the factory method pattern is a creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created.

Detailed explanation-2: -Q 7-Which of the following is correct about Factory design pattern. A-This type of design pattern comes under creational pattern. B-Factory pattern creates object without exposing the creation logic to the client. C-Factory pattern refers to newly created object using a common interface.

Detailed explanation-3: -Factory Method is a creational design pattern that provides an interface for creating objects in a superclass, but allows subclasses to alter the type of objects that will be created.

There is 1 question to complete.