Support us .Net Basics C# SQL ASP.NET Aarvi MVC Slides C# Programs Subscribe Download

Part 4 - What are the advantages of using interfaces

Suggested Videos:
Part 1 - Can you store different types in an array in c#
Part 2 - What is jagged array
Part 3 - Why and when should we use an abstract class



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.

4 comments:

  1. Venkat Sir,
    Please discuss the advantages of interface that you hinted in your interface video.

    Thanks

    ReplyDelete
  2. Venkat Sir,
    Please discuss the advantages of interface that you hinted in your interface video.

    Thanks

    ReplyDelete
  3. Sir pls upload video on Advantages of Interfaces,waiting from many days

    ReplyDelete
  4. sir plz Please discuss the advantages of interface that you hinted in your interface video

    ReplyDelete

It would be great if you can help share these free resources