Intermediate Web & Software Development
Q44 / 100

What is the Dependency Inversion Principle?

Correct! Well done.

Incorrect.

The correct answer is B) High-level modules should not depend on low-level modules; both should depend on abstractions (interfaces), and abstractions should not depend on details

B

Correct Answer

High-level modules should not depend on low-level modules; both should depend on abstractions (interfaces), and abstractions should not depend on details

Explanation

DIP enables loose coupling: UserService depends on IUserRepository (interface), not MySQLUserRepository (concrete). Concrete implementation injected via DI. Enables testing with mocks and swapping implementations.

Progress
44/100