Part 4 What are the advantages of using interfaces

Link for code samples used in the demo

Link for csharp,,, dotnet basics, mvc and sql server video tutorial playlists

This question can be asked in different forms
1. Why would you use interfaces
2. An interface does not contain any implementation, only declarations. So what is the benefit of using an interface?
3. Why would you define an interface, have a class implement that interface and then access the class through the interface instead of just using the class directly.

The following are the advantages of programming against interfaces over programming against concrete classes.
1. Interfaces allow us to develop loosely coupled systems.
2. Interfaces are very useful for Dependency Injection.
3. Interfaces make unit testing and mocking easier.

We will discuss examples of each of these advantages in our upcoming videos.

    .Net abstract abstract class advantage Advantages array arraylist AS benefits block C (Programming Language) C# c# class default constructor access modifier c# interview questions and answers c# reflection constructor access modifier c# reflection constructor not found c# reflection default constructor c# reflection get constructor c# reflection private constructor c# reflection protected constructor call cast catch class constructor csharp Data DataTypes difference between Difference between int and Int32 in c# different directory dot net dotnet Each example exception exceptions factorial files Finally folder frequently asked function generic Handle happens int vs int32 interfaces interview is jagged keyword LINQ list Lists method Number occur Operator Overriding purpose question questions Real Real-time real-world realtime Recursion recursive reverse Sentence single store String Structure subdirectories Throw throws time try Types Use using virtual method what when where Why Word World