Design Patterns · Junior · Question 30 of 75
What does the Dependency Inversion Principle (DIP) mean?
- ✓Correct answer: High-level modules depend on abstractions, not on concrete implementations
- 2Dependencies in
package.jsonmust be sorted in reverse order - 3Low-level modules should import high-level ones, not the other way round
Explanation
An order service depends on a PaymentGateway interface, not on a specific Stripe SDK. The implementation is passed in from outside, so it's easy to replace or mock in tests.