SOFTWARE DESIGN
DESIGN PATTERNS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
Which text below describes the Strategy Pattern best?
|
Encapsulates interchangeable behaviours and uses delegation to decide which one to use.
|
|
Simplifies the interface of a group of classes.
|
|
Provides a way to traverse a collection of objects without exposing the collection’s implementation.
|
|
Changes the interface of one or more classes.
|
|
Client treats collections of objects and individual objects uniformly.
|
Explanation:
Detailed explanation-1: -Q. Which text below describes the Abstract Factory Pattern best? It changes the interface of one or more classes. It encapsulates interchangeable behaviours and uses delegation to decide which one to use.
Detailed explanation-2: -Strategy design pattern is one of the behavioral design pattern. Strategy pattern is used when we have multiple algorithm for a specific task and client decides the actual implementation to be used at runtime.
Detailed explanation-3: -The Decorator Pattern provides an alternative to subclassing for extending behavior. The Decorator Pattern involves a set of decorator classes that are used to wrap concrete components. Decorator classes mirror the type of the components they decorate.
There is 1 question to complete.