Click here to Skip to main content
15,899,475 members
Home / Discussions / C#
   

C#

 
AnswerRe: A few pointers toward design Pin
DaveyM6912-Feb-10 13:18
professionalDaveyM6912-Feb-10 13:18 
GeneralRe: A few pointers toward design [modified] Pin
Saksida Bojan12-Feb-10 18:54
Saksida Bojan12-Feb-10 18:54 
GeneralRe: A few pointers toward design Pin
DaveyM6912-Feb-10 23:42
professionalDaveyM6912-Feb-10 23:42 
GeneralRe: A few pointers toward design Pin
Saksida Bojan13-Feb-10 0:10
Saksida Bojan13-Feb-10 0:10 
GeneralRe: A few pointers toward design Pin
DaveyM6912-Feb-10 23:55
professionalDaveyM6912-Feb-10 23:55 
Questionbaseclass and a interface. Pin
Jarno Burger12-Feb-10 8:42
Jarno Burger12-Feb-10 8:42 
AnswerRe: baseclass and a interface. Pin
Saksida Bojan12-Feb-10 10:16
Saksida Bojan12-Feb-10 10:16 
AnswerRe: baseclass and a interface. Pin
rhuiden12-Feb-10 10:24
rhuiden12-Feb-10 10:24 
I think that would be the way to go. I would also declare commandC in classA as abstract and force an override.

Alternative:
If you have a lot of commands that would have to overridden, you would want to use interface inheritance.
-interfaceX would not have the definition for commandC.
-You could then create interfaceY that inherits interfaceX and define commandC.
-Classes B-D would inherit classA and implement interfaceY.
-In classX you would call interfaceY.

The only problem with your method: If you later change the definition of interfaceX you would have to change all the classes (classA would have to be modified even though there is no real change). This would also be true if you wanted to add a method. It all depends on the size of your classes/interface and how often they will change.
GeneralRe: baseclass and a interface. Pin
Jarno Burger14-Feb-10 13:33
Jarno Burger14-Feb-10 13:33 
Questioncodes Pin
ajay 201012-Feb-10 7:27
ajay 201012-Feb-10 7:27 
AnswerRe: codes Pin
Wes Aday12-Feb-10 7:46
professionalWes Aday12-Feb-10 7:46 
GeneralRe: codes Pin
ajay 201012-Feb-10 16:41
ajay 201012-Feb-10 16:41 
GeneralRe: codes Pin
Wes Aday12-Feb-10 17:11
professionalWes Aday12-Feb-10 17:11 
GeneralRe: codes Pin
ajay 201012-Feb-10 18:04
ajay 201012-Feb-10 18:04 
GeneralRe: codes Pin
ajay 201012-Feb-10 18:51
ajay 201012-Feb-10 18:51 
AnswerRe: codes Pin
hammerstein0512-Feb-10 8:00
hammerstein0512-Feb-10 8:00 
GeneralRe: codes Pin
ajay 201012-Feb-10 16:43
ajay 201012-Feb-10 16:43 
GeneralRe: codes Pin
hammerstein0512-Feb-10 18:35
hammerstein0512-Feb-10 18:35 
GeneralRe: codes Pin
ajay 201012-Feb-10 18:46
ajay 201012-Feb-10 18:46 
AnswerRe: codes Pin
OriginalGriff12-Feb-10 8:20
mveOriginalGriff12-Feb-10 8:20 
GeneralRe: codes Pin
Dan Mos12-Feb-10 8:26
Dan Mos12-Feb-10 8:26 
GeneralRe: codes Pin
OriginalGriff12-Feb-10 8:44
mveOriginalGriff12-Feb-10 8:44 
GeneralRe: codes Pin
Dan Mos12-Feb-10 8:52
Dan Mos12-Feb-10 8:52 
GeneralRe: codes Pin
ajay 201012-Feb-10 16:45
ajay 201012-Feb-10 16:45 
AnswerRe: codes Pin
Dr.Walt Fair, PE12-Feb-10 8:29
professionalDr.Walt Fair, PE12-Feb-10 8:29 

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.