an example with the Dependency Inversion Principle looks incomplete as it should get a service as a param in the constructor, so you can pass any service that you need (Emal, SMS, etc.). With the provided example in case, if you need to use SMS service instead of Email, you need literally change the Notification class...

Oleksii Tymoshchenko
Oleksii Tymoshchenko

Written by Oleksii Tymoshchenko

I have been developing for Android with Java and Kotlin from 2015.

No responses yet