Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
3.67/5 (2 votes)
See more:
hi foxes how are you
i always ask when and why i need to implement interfaces.
i am almost 2 years programming and i never felt like i need interface in my pattern
can some one please explain the important and benefits of it and practical cases that cant be handle without it or at least any references can help in that point
thanx
Posted
Updated 22-Aug-14 7:08am
v3
Comments
george4986 23-Aug-14 7:18am    
consider u have an erp project on which u have added dlls for modules like hr,payroll,inventory,...so on. U can use interface class to pass(communicate) data(eg:user name,login company,location..fetched on login time) to forms in the dlls. Each forms u need to inherit the interface class ,set properties & constructor.From calling form create object of interface class and pass values(usually on calling time of each form).

A simple search here on Code Project finds these and many more articles:

Why do we need Interfaces?[^]

Interfaces and its Importance[^]

Demystifying interfaces in C#[^]
 
Share this answer
 
See http://msdn.microsoft.com/en-gb/library/87d83y5b.aspx[^]. An interface is basically a contract, if you implement the interface you must provide all the elements (methods and properties) listed in the contract.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900