Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
AnswerRe: Designing: Multiple interfaces implementation on classes Pin
Ravi Sant8-Nov-11 21:15
Ravi Sant8-Nov-11 21:15 
GeneralRe: Designing: Multiple interfaces implementation on classes Pin
jschell9-Nov-11 11:13
jschell9-Nov-11 11:13 
GeneralRe: Designing: Multiple interfaces implementation on classes Pin
Ravi Sant10-Nov-11 2:29
Ravi Sant10-Nov-11 2:29 
AnswerRe: Designing: Multiple interfaces implementation on classes PinPopular
BobJanova8-Nov-11 23:15
BobJanova8-Nov-11 23:15 
GeneralRe: Designing: Multiple interfaces implementation on classes Pin
vinayvraman9-Nov-11 0:34
vinayvraman9-Nov-11 0:34 
AnswerRe: Designing: Multiple interfaces implementation on classes Pin
Ravi Bhavnani9-Nov-11 2:07
professionalRavi Bhavnani9-Nov-11 2:07 
GeneralRe: Designing: Multiple interfaces implementation on classes Pin
vinayvraman9-Nov-11 3:58
vinayvraman9-Nov-11 3:58 
AnswerRe: Designing: Multiple interfaces implementation on classes Pin
BillWoodruff10-Nov-11 5:49
professionalBillWoodruff10-Nov-11 5:49 
goodpeapul wrote:
My question is how many interfaces can be implemented on a single class?
In my humble opinion asking "how many" is not quite the right focus on the broad issue of why and how to use Interfaces.

Clearly Interfaces can have multiple uses:

1. to enforce an implementation contract on implementers of an Interface. That "contract" forcing you at compile-time to deal with failure to 'meet the terms of the contract.'

2. to encapsulate "shared behavior" used consistently across implementers of the Interface.

3. via casting instances of Interface implementers to the Interface: to expose a limited subset of functionality, or content, of the instance to other Objects.

4. via discriminate use of implicit and explicit Interfaces to obtain the advantages of all of the above while avoiding semantic confusion, or overlap.

imho the idea of "single responsibility" is as applicable to a set of behaviors (methods, functions), as it is to classes.

Interfaces are one tool to help achieve that.

It may be of interest to you to read Erich Gamma's comments on interfaces here in this 2005 interview:[^]: scroll down to the section titled "Program to an interface, not an implementation."

From a humble student of Interfaces and their strategic uses.

best, Bill
"I have always wished for my computer to be as easy to use as my
telephone; my wish has come true because I can no longer figure out
how to use my telephone." Bjarne Stroustrop circa 1990

QuestionHow to Sleep a Thread? Pin
namelkcip8-Nov-11 16:46
namelkcip8-Nov-11 16:46 
AnswerRe: How to Sleep a Thread? Pin
lukeer8-Nov-11 22:00
lukeer8-Nov-11 22:00 
GeneralRe: How to Sleep a Thread? Pin
namelkcip10-Nov-11 4:40
namelkcip10-Nov-11 4:40 
GeneralRe: How to Sleep a Thread? Pin
lukeer10-Nov-11 21:04
lukeer10-Nov-11 21:04 
AnswerRe: How to Sleep a Thread? Pin
BobJanova8-Nov-11 23:19
BobJanova8-Nov-11 23:19 
QuestionWhat am I doing wrong? Pin
Member 83630848-Nov-11 15:33
Member 83630848-Nov-11 15:33 
AnswerRe: What am I doing wrong? Pin
Hum Dum8-Nov-11 17:09
Hum Dum8-Nov-11 17:09 
AnswerRe: What am I doing wrong? Pin
RobCroll8-Nov-11 17:09
RobCroll8-Nov-11 17:09 
QuestionAce OLE driver with Extended Properties Pin
Alaric_8-Nov-11 10:18
professionalAlaric_8-Nov-11 10:18 
AnswerRe: Ace OLE driver with Extended Properties Pin
Dave Kreskowiak8-Nov-11 13:28
mveDave Kreskowiak8-Nov-11 13:28 
GeneralRe: Ace OLE driver with Extended Properties Pin
Alaric_15-Nov-11 9:59
professionalAlaric_15-Nov-11 9:59 
QuestionRemoving Mutex and file lock using DLL injection (Guild Wars) in C# Pin
KairuByte8-Nov-11 8:06
KairuByte8-Nov-11 8:06 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
harold aptroot8-Nov-11 8:37
harold aptroot8-Nov-11 8:37 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
KairuByte8-Nov-11 8:50
KairuByte8-Nov-11 8:50 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
harold aptroot8-Nov-11 9:01
harold aptroot8-Nov-11 9:01 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
KairuByte8-Nov-11 9:06
KairuByte8-Nov-11 9:06 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
harold aptroot8-Nov-11 9:10
harold aptroot8-Nov-11 9:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.