Click here to Skip to main content
15,919,422 members
Home / Discussions / C#
   

C#

 
AnswerRe: populate treeview from database Pin
Richard Blythe8-Dec-09 17:50
Richard Blythe8-Dec-09 17:50 
GeneralRe: populate treeview from database Pin
kruegs359-Dec-09 3:10
kruegs359-Dec-09 3:10 
QuestionReportViewer 2005 C# Printing issue [modified] Pin
.NET4Ever8-Dec-09 12:26
.NET4Ever8-Dec-09 12:26 
QuestionTo be liberal or conservative with virtual methods... Pin
CaptainSeeSharp8-Dec-09 10:13
CaptainSeeSharp8-Dec-09 10:13 
AnswerRe: To be liberal or conservative with virtual methods... Pin
PIEBALDconsult8-Dec-09 10:31
mvePIEBALDconsult8-Dec-09 10:31 
GeneralRe: To be liberal or conservative with virtual methods... Pin
CaptainSeeSharp8-Dec-09 10:36
CaptainSeeSharp8-Dec-09 10:36 
GeneralRe: To be liberal or conservative with virtual methods... Pin
PIEBALDconsult8-Dec-09 10:39
mvePIEBALDconsult8-Dec-09 10:39 
GeneralRe: To be liberal or conservative with virtual methods... Pin
harold aptroot8-Dec-09 10:41
harold aptroot8-Dec-09 10:41 
GeneralRe: To be liberal or conservative with virtual methods... Pin
PIEBALDconsult8-Dec-09 10:47
mvePIEBALDconsult8-Dec-09 10:47 
GeneralRe: To be liberal or conservative with virtual methods... Pin
harold aptroot8-Dec-09 10:55
harold aptroot8-Dec-09 10:55 
GeneralRe: To be liberal or conservative with virtual methods... Pin
PIEBALDconsult8-Dec-09 10:57
mvePIEBALDconsult8-Dec-09 10:57 
GeneralRe: To be liberal or conservative with virtual methods... Pin
Pete O'Hanlon8-Dec-09 11:10
mvePete O'Hanlon8-Dec-09 11:10 
GeneralRe: To be liberal or conservative with virtual methods... Pin
PIEBALDconsult8-Dec-09 13:33
mvePIEBALDconsult8-Dec-09 13:33 
AnswerRe: To be liberal or conservative with virtual methods... Pin
Jimmanuel8-Dec-09 10:58
Jimmanuel8-Dec-09 10:58 
GeneralRe: To be liberal or conservative with virtual methods... Pin
PIEBALDconsult8-Dec-09 11:11
mvePIEBALDconsult8-Dec-09 11:11 
GeneralRe: To be liberal or conservative with virtual methods... Pin
Jimmanuel8-Dec-09 11:21
Jimmanuel8-Dec-09 11:21 
GeneralRe: To be liberal or conservative with virtual methods... Pin
PIEBALDconsult8-Dec-09 11:52
mvePIEBALDconsult8-Dec-09 11:52 
GeneralRe: To be liberal or conservative with virtual methods... Pin
Jimmanuel8-Dec-09 12:44
Jimmanuel8-Dec-09 12:44 
GeneralRe: To be liberal or conservative with virtual methods... Pin
PIEBALDconsult8-Dec-09 13:03
mvePIEBALDconsult8-Dec-09 13:03 
GeneralRe: To be liberal or conservative with virtual methods... [modified] Pin
PIEBALDconsult8-Dec-09 14:46
mvePIEBALDconsult8-Dec-09 14:46 
GeneralRe: To be liberal or conservative with virtual methods... Pin
Jimmanuel8-Dec-09 15:34
Jimmanuel8-Dec-09 15:34 
GeneralRe: To be liberal or conservative with virtual methods... [modified] Pin
PIEBALDconsult8-Dec-09 16:26
mvePIEBALDconsult8-Dec-09 16:26 
AnswerRe: To be liberal or conservative with virtual methods... Pin
Daniel Grunwald8-Dec-09 15:05
Daniel Grunwald8-Dec-09 15:05 
A class needs to be designed for inheritance. If you just make stuff virtual, you end up with the fragile base class problem[^].

Composition (and encapsulation) is way better than inheritance.

If the base class calls any of its own virtual methods, this must be documented! And any future change to these internal calls must be considered a breaking API change. See http://www.javaworld.com/javaworld/jw-08-2003/jw-0801-toolbox.html?page=3[^] for an example.

Usually, I just make my classes sealed. Extensibility is hard work, just slapping a few virtual modifiers on your methods without thinking will only cause trouble in the long run.
GeneralRe: To be liberal or conservative with virtual methods... Pin
PIEBALDconsult8-Dec-09 17:44
mvePIEBALDconsult8-Dec-09 17:44 
QuestionCheckedListBox state to property Pin
BDJones8-Dec-09 7:06
BDJones8-Dec-09 7:06 

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.