Step 5 – applying the dependency inversion principle
If you are familiar with the dependency inversion principle, you will certainly have already noticed that the BookmarkService
class does not implement any interface.
Let’s start by fixing this.
I am not familiar with the dependency inversion principle!
If you are not, there are plenty of great resources to explore this principle. It is not a complicated principle to understand, and quite frankly, after you learn about it, it will seem so obvious to you that you will be wondering why you did not know about it earlier.
A great explanation of that principle can be found at https://www.c-sharpcorner.com/article/dependency-inversion-principle-in-c-sharp/.
I highly encourage you to go and review the implementation of the BookmarkService
service before and after applying the dependency inversion principle in order to have a clear understanding of the benefits.
Back to our project structure discussion, we...