Question OOP-SOLID-0046
MediumA NightlyReport class directly creates a new MySqlConnection() inside its run() method. Which change best follows Dependency Inversion?
- A.
Make NightlyReport take a DataSource interface in its constructor
- B.
Copy the connection code into every report
- C.
Sign up free to see the answer and a step-by-step explanation.