SOFTWARE DESIGN
DESIGN PATTERNS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
What pattern you can use when having a lot of duplicate code across similar states and transitions of a condition-based state machine.
|
Observer
|
|
Mediator
|
|
State
|
|
Command
|
Explanation:
Detailed explanation-1: -Use State when you have a lot of duplicate code across similar states and transitions of a condition-based state machine. The State pattern lets you compose hierarchies of state classes and reduce duplication by extracting common code into abstract base classes.
Detailed explanation-2: -Prototype pattern refers to creating duplicate object while keeping performance in mind.
Detailed explanation-3: -Mediator pattern is used to reduce communication complexity between multiple objects or classes.
There is 1 question to complete.