SOFTWARE ENGINEERING

SOFTWARE DESIGN

DESIGN PATTERNS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which text below describes the Template Method pattern best?
A
Encapsulates interchangeable behaviours and uses delegation to decide which one to use.
B
Simplifies the interface of a group of classes.
C
Subclasses decide how to implement steps in an algorithm.
D
Changes the interface of one or more classes.
E
Allows (a group of) objects to be notified when some state changes.
Explanation: 

Detailed explanation-1: -Template Method is a behavioral design pattern. Template Method design pattern is used to create a method stub and deferring some of the steps of implementation to the subclasses.

Detailed explanation-2: -GoF Definition Template method lets subclasses redefine certain steps of an algorithm without changing the algorithm’s structure.

There is 1 question to complete.