Click here to Skip to main content
15,889,216 members
Home / Discussions / C#
   

C#

 
GeneralRe: Console component Pin
noon427-Aug-07 14:51
noon427-Aug-07 14:51 
GeneralRe: Console component Pin
Luc Pattyn7-Aug-07 15:04
sitebuilderLuc Pattyn7-Aug-07 15:04 
GeneralRe: Console component Pin
noon427-Aug-07 15:20
noon427-Aug-07 15:20 
QuestionInterface VS Abstract classes Pin
seemamltn7-Aug-07 13:58
seemamltn7-Aug-07 13:58 
GeneralRe: Interface VS Abstract classes Pin
PIEBALDconsult7-Aug-07 14:07
mvePIEBALDconsult7-Aug-07 14:07 
AnswerRe: Interface VS Abstract classes Pin
Christian Graus7-Aug-07 14:30
protectorChristian Graus7-Aug-07 14:30 
AnswerRe: Interface VS Abstract classes Pin
Jeff.Hu7-Aug-07 17:16
Jeff.Hu7-Aug-07 17:16 
AnswerRe: Interface VS Abstract classes Pin
tker7-Aug-07 18:32
tker7-Aug-07 18:32 
Hi Seema,

Interfaces are essential when programming using Component Orientated Design as opposed to OOD. In general I tend towards using Interface inheritance as I code for components, not objects. Components are more flexible and reusable, in no small part due to the way they interact using Interfaces and thus separate interface from implementation, making reimplementation or reuse easier.

Interface based inheritance means simplifies greatly the use of inheritance and polymorphism as abstract classes may implement member variables or provide virtual functions as well as abstract functions which can make the hierarchy more fragile and prone to reuse issues. If you need common functionality across a number of subclasses then an abstract class is useful; it is, however, also useful to make that abstract class implement an interface for its subclasses to use as their contract with their clients as well.

A class may only implement one base class, but can implement multiple interfaces. If an interface implements another interfaces then classes that implement that interface will have to implement the methods for both. Conflicts may be resolved via explicit interface inference or by channeling both into one method (or a combination). As with abstract classes, interfaces may be Generic and decorated with attributes.

Interfaces are a very useful and powerful construct. I would recommend their use heavily to achieve a component based architecture rather than an object based architecture.

Toby

Toby Russell
QuestionTreeView nodes Tooltiptext Pin
unitecsoft7-Aug-07 12:57
unitecsoft7-Aug-07 12:57 
AnswerRe: TreeView nodes Tooltiptext Pin
Luc Pattyn7-Aug-07 14:25
sitebuilderLuc Pattyn7-Aug-07 14:25 
GeneralRe: TreeView nodes Tooltiptext Pin
unitecsoft7-Aug-07 21:31
unitecsoft7-Aug-07 21:31 
QuestionCan a base class access a derived class? Pin
eggie57-Aug-07 12:25
eggie57-Aug-07 12:25 
AnswerRe: Can a base class access a derived class? Pin
il_masacratore7-Aug-07 12:34
il_masacratore7-Aug-07 12:34 
AnswerRe: Can a base class access a derived class? Pin
Christian Graus7-Aug-07 12:44
protectorChristian Graus7-Aug-07 12:44 
GeneralRe: Can a base class access a derived class? Pin
PIEBALDconsult7-Aug-07 14:04
mvePIEBALDconsult7-Aug-07 14:04 
GeneralRe: Can a base class access a derived class? Pin
Christian Graus7-Aug-07 14:27
protectorChristian Graus7-Aug-07 14:27 
GeneralRe: Can a base class access a derived class? Pin
PIEBALDconsult8-Aug-07 6:11
mvePIEBALDconsult8-Aug-07 6:11 
QuestionNgen Pin
il_masacratore7-Aug-07 12:09
il_masacratore7-Aug-07 12:09 
AnswerRe: Ngen Pin
Judah Gabriel Himango7-Aug-07 13:06
sponsorJudah Gabriel Himango7-Aug-07 13:06 
QuestionReflection Example Pin
eggie57-Aug-07 11:03
eggie57-Aug-07 11:03 
AnswerRe: Reflection Example Pin
Farhan Noor Qureshi7-Aug-07 11:41
Farhan Noor Qureshi7-Aug-07 11:41 
GeneralRe: Reflection Example Pin
eggie57-Aug-07 20:29
eggie57-Aug-07 20:29 
GeneralRe: Reflection Example Pin
Nissim Salomon7-Aug-07 21:48
Nissim Salomon7-Aug-07 21:48 
GeneralRe: Reflection Example Pin
eggie514-Aug-07 17:56
eggie514-Aug-07 17:56 
QuestionToolStripSplit Button and related problems Pin
logicon7-Aug-07 10:47
logicon7-Aug-07 10:47 

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.