I have three interface like this:
interface IStorable{
void read();
}
interface ITalk{
void talk();
}
interface IRun{
void run
}
I have 3 class (Document, Note, NoteRun) which the first class is the second base clase, the second class is the third base class. All the methods in class 1 is writen in explicit interface implementation.
public class Document:IStorable,ITalk{
//Constructor...
void IStorable.read{
//something;
}
void ITalk.talk{
//something;
}
}
public class Note
ocument,IStorable,ITalk{
//Constructor...
void IStorable.read{
//something;
}
void ITalk.talk{
//something;
}
}
public class NoteRun:Note, IStorable,ITalk,IRun{
//Constructor...
void IStorable.read{
//something;
}
void ITalk.talk{
//something;
}
void IRun.run{
//something;
}
}
Now I just curious is there any other way to avoid these growing declaration:
public class Document:IStorable,ITalk
public class Note
ocument,IStorable,ITalk
public class NoteRun:Note, IStorable,ITalk,IRun
Everytime I make new derived class, I have to write down all of the interface.......?
I just wonder the negatif effect of this explicit interface implementation declaration..
Sincerely Yours,
Pujo
interface IStorable{
void read();
}
interface ITalk{
void talk();
}
interface IRun{
void run
}
I have 3 class (Document, Note, NoteRun) which the first class is the second base clase, the second class is the third base class. All the methods in class 1 is writen in explicit interface implementation.
public class Document:IStorable,ITalk{
//Constructor...
void IStorable.read{
//something;
}
void ITalk.talk{
//something;
}
}
public class Note
//Constructor...
void IStorable.read{
//something;
}
void ITalk.talk{
//something;
}
}
public class NoteRun:Note, IStorable,ITalk,IRun{
//Constructor...
void IStorable.read{
//something;
}
void ITalk.talk{
//something;
}
void IRun.run{
//something;
}
}
Now I just curious is there any other way to avoid these growing declaration:
public class Document:IStorable,ITalk
public class Note
public class NoteRun:Note, IStorable,ITalk,IRun
Everytime I make new derived class, I have to write down all of the interface.......?
I just wonder the negatif effect of this explicit interface implementation declaration..
Sincerely Yours,
Pujo