Support us .Net Basics C# SQL ASP.NET ADO.NET MVC Slides C# Programs Subscribe Buy DVD

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.

2 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

If you like this website, please share with your friends on facebook and Google+ and recommend us on google using the g+1 button on the top right hand corner.