SOFTWARE ENGINEERING

SOFTWARE DESIGN

DESIGN PATTERNS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Implementation of State Pattern organizes the code related to particular states into separate classes and introduces new states without changing existing state classes or the context. Which of SOLID principles would follow you?
A
Single Responsibility
B
Open/Closed
C
Interface Segregation
D
Dependency Inversion
Explanation: 

Detailed explanation-1: -Structural design patterns These design patterns are all about Class and Object composition. Structural class-creation patterns use inheritance to compose interfaces. Structural object-patterns define ways to compose objects to obtain new functionality.

Detailed explanation-2: -The state pattern is used in computer programming to encapsulate varying behavior for the same object, based on its internal state. This can be a cleaner way for an object to change its behavior at runtime without resorting to conditional statements and thus improve maintainability.

There is 1 question to complete.