Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
AnswerRe: Manual Coding vs Code Generation Pin
PIEBALDconsult21-Nov-12 4:00
mvePIEBALDconsult21-Nov-12 4:00 
QuestionDesign Question Pin
PozzaVecia15-Nov-12 17:31
PozzaVecia15-Nov-12 17:31 
AnswerRe: Design Question Pin
DaveyM6915-Nov-12 19:31
professionalDaveyM6915-Nov-12 19:31 
GeneralRe: Design Question Pin
PozzaVecia15-Nov-12 20:11
PozzaVecia15-Nov-12 20:11 
AnswerRe: Design Question Pin
Rahul Rajat Singh15-Nov-12 21:43
professionalRahul Rajat Singh15-Nov-12 21:43 
GeneralRe: Design Question Pin
PozzaVecia15-Nov-12 23:14
PozzaVecia15-Nov-12 23:14 
AnswerRe: Design Question Pin
Rahul Rajat Singh15-Nov-12 23:22
professionalRahul Rajat Singh15-Nov-12 23:22 
AnswerRe: Design Question PinPopular
BobJanova15-Nov-12 23:12
BobJanova15-Nov-12 23:12 
TheGermoz wrote:
class A can implements I1 or I2 depending on how it is constructed

This is a dead giveaway for poor design. Inheritance hierarchies are telling you what operations you can do on an object, and you should be able to tell from the type of something what you can do with it. That is, an instance of A should always be treatable as an I2, or never.

What you almost certainly want to do is:

interface I1 {
 void A();
 void B();
}

interface I2 : I1 {
 void C();
 void D();
}

class A : I1 {
 // Implementations of the I1 functionality, and the I1 type constructor
 public virtual void A() {}
 public virtual void B() {}
}

class A2 : A, I2 {
 // Implementations of the I2 functionality, and the I2 type constructor
 public void C() {}
 public void D() {}

 // You can also override implementations from A
 public override void A() {
  base.A();
  // other stuff
 }
}

GeneralRe: Design Question Pin
PozzaVecia15-Nov-12 23:16
PozzaVecia15-Nov-12 23:16 
GeneralRe: Design Question Pin
Rahul Rajat Singh15-Nov-12 23:35
professionalRahul Rajat Singh15-Nov-12 23:35 
GeneralRe: Design Question Pin
BobJanova16-Nov-12 0:09
BobJanova16-Nov-12 0:09 
AnswerRe: Design Question Pin
SledgeHammer0116-Nov-12 9:53
SledgeHammer0116-Nov-12 9:53 
GeneralRe: Design Question Pin
PozzaVecia16-Nov-12 10:06
PozzaVecia16-Nov-12 10:06 
AnswerRe: Design Question Pin
Clifford Nelson16-Nov-12 9:53
Clifford Nelson16-Nov-12 9:53 
QuestionBackground worker thread Pin
MAW3015-Nov-12 14:54
MAW3015-Nov-12 14:54 
AnswerRe: Background worker thread Pin
DaveyM6915-Nov-12 18:51
professionalDaveyM6915-Nov-12 18:51 
QuestionArray, Struct, Class??? I'm so confused.... Pin
KKW_acd15-Nov-12 6:29
KKW_acd15-Nov-12 6:29 
AnswerRe: Array, Struct, Class??? I'm so confused.... Pin
DaveyM6915-Nov-12 6:55
professionalDaveyM6915-Nov-12 6:55 
GeneralRe: Array, Struct, Class??? I'm so confused.... Pin
KKW_acd15-Nov-12 9:03
KKW_acd15-Nov-12 9:03 
AnswerRe: Array, Struct, Class??? I'm so confused.... Pin
DaveyM6915-Nov-12 19:02
professionalDaveyM6915-Nov-12 19:02 
GeneralRe: Array, Struct, Class??? I'm so confused.... Pin
Richard MacCutchan16-Nov-12 0:02
mveRichard MacCutchan16-Nov-12 0:02 
AnswerRe: Array, Struct, Class??? I'm so confused.... Pin
Richard MacCutchan15-Nov-12 7:06
mveRichard MacCutchan15-Nov-12 7:06 
AnswerRe: Array, Struct, Class??? I'm so confused.... Pin
BobJanova16-Nov-12 0:16
BobJanova16-Nov-12 0:16 
QuestionWind Chill Automation with C# application Pin
omisheikh15-Nov-12 6:03
omisheikh15-Nov-12 6:03 
AnswerRe: Wind Chill Automation with C# application Pin
jschell15-Nov-12 8:12
jschell15-Nov-12 8:12 

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.