Inverting a Dependency One Safe Step at a Time

A ReportScheduler class creates a concrete MySqlReportStore inside its own code, so the scheduler cannot be unit-tested without a running database. You decide to apply the Dependency Inversion Principle. Your team requires that the program still compiles and every existing test still passes after each individual step. Arrange the steps in the order that satisfies this constraint.

Loading ordering steps…

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Design Principles Questions: