← Quiz: SOLID Principles: all 10 questions
Quiz: SOLID Principles · Question 6 of 10
According to Dependency Inversion, what should a high-level FeeReminder class depend on?
According to Dependency Inversion, what should a high-level FeeReminder class depend on?
- A.Directly on
EmailSender - B.An abstraction such as
MessageSender - C.The database driver
- D.Nothing — it should create everything itself
Answer & explanation
Correct answer: An abstraction such as MessageSender
Both the business rule and the email code depend on the abstraction, so senders can be swapped.
Can you get the rest right without peeking?
Take the timed Quiz: SOLID Principles quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →