SOFTWARE DESIGN
DESIGN PATTERNS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Inverse the class inheritance via interfaces.
|
|
Have abstract classes implement interfaces.
|
|
Depend upon abstractions.
|
|
Do depend upon concrete classes.
|
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.