Design Patterns · Junior · Question 30 of 75

What does the Dependency Inversion Principle (DIP) mean?

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.

Further reading

Problem with a question

Design Patterns · Junior · question 30

Test yourself

Take the Design Patterns · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz