SOFTWARE ENGINEERING

SOFTWARE DESIGN

DESIGN PATTERNS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What statement about the Dependency Inversion Principle is correct?
A
Inverse the class inheritance via interfaces.
B
Have abstract classes implement interfaces.
C
Depend upon abstractions.
D
Do depend upon concrete classes.
Explanation: 

Detailed explanation-1: -The principle states: High-level modules should not import anything from low-level modules. Both should depend on abstractions (e.g., interfaces). Abstractions should not depend on details.

Detailed explanation-2: -The dependency inversion principle is a design principle that states that high-level modules should depend on abstractions rather than concrete implementations. This helps decouple the high-level and low-level modules, making it easier to change the low-level ones without affecting the high-level ones.

Detailed explanation-3: -The dependency inversion indicates the following: High-level modules should not depend on low-level modules. Both should depend on abstractions. Abstractions should not depend on details.

Detailed explanation-4: -Following two statements are core of the Dependency Inversion Principle(DIP): “High-level modules should not depend on low-level modules. Both should depend on abstractions.” “Abstractions should not depend on details.

There is 1 question to complete.