Object dependency
Our changes to the MailService class have introduced an object dependency. In order for the MailService class to function, it is now dependent on an instance of a class that provides the implementation of the ISystemSettings interface. mailService is therefore dependent on a class that implements the ISystemSettings interface.
This dependency is actually a good thing. It means that we can provide different versions of classes that implement the ISystemSettings interface, without making any changes to our MailService code. This allows us to configure the environment that the MailService class runs within, whether in development, testing, FAT, or production.
It also allows us to test some boundary conditions. In other words, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access