Design Patterns · Senior · Question 58 of 75

Two packages: checkout needs to send emails, and notifications implements email sending. Following DIP, who owns the interface?

Explanation

High-level policy then doesn't depend on low-level details, and implementations can be swapped or faked in tests.

Further reading

Problem with a question

Design Patterns · Senior · question 58

Test yourself

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

Take this quiz