Click here to Skip to main content
15,888,527 members
Home / Discussions / C#
   

C#

 
GeneralRe: inheriting varibles from within a class Pin
antrock10112-May-09 17:25
antrock10112-May-09 17:25 
GeneralRe: inheriting varibles from within a class Pin
antrock10112-May-09 17:36
antrock10112-May-09 17:36 
GeneralRe: inheriting varibles from within a class Pin
PIEBALDconsult12-May-09 17:46
mvePIEBALDconsult12-May-09 17:46 
GeneralRe: inheriting varibles from within a class Pin
antrock10112-May-09 18:00
antrock10112-May-09 18:00 
GeneralUsing the New keyword Pin
Mycroft Holmes12-May-09 15:23
professionalMycroft Holmes12-May-09 15:23 
GeneralRe: Using the New keyword Pin
Luc Pattyn12-May-09 17:09
sitebuilderLuc Pattyn12-May-09 17:09 
GeneralRe: Using the New keyword Pin
Mycroft Holmes12-May-09 19:06
professionalMycroft Holmes12-May-09 19:06 
GeneralRe: Using the New keyword Pin
PIEBALDconsult12-May-09 17:34
mvePIEBALDconsult12-May-09 17:34 
It sounds like you're trying to override a method in a base class which doesn't allow polymorphic inheritence; which is all too common in .net and you're right to think twice.

In my opinion, non-polymorphic inheritence (via new) should be avoided. Unfortunately, the only alternative is likely to be wrapping the class and then having to implement all the public methods and properties of the wrapped class, which is a total pain the [wrist].

If you proceed with non-poly-whosis be aware that a user of your class may be able to bypass your implementation and access the base class' implementation; you will need to be sure that this will not leave the instance in an invalid state.


Mycroft Holmes wrote:
I am a great believer in elegant and correct code


If only Microsoft was; then methods would be virtual by default.
GeneralRe: Using the New keyword Pin
N a v a n e e t h12-May-09 18:15
N a v a n e e t h12-May-09 18:15 
GeneralRe: Using the New keyword Pin
PIEBALDconsult13-May-09 3:21
mvePIEBALDconsult13-May-09 3:21 
GeneralRe: Using the New keyword Pin
Mycroft Holmes12-May-09 19:09
professionalMycroft Holmes12-May-09 19:09 
GeneralRe: Using the New keyword Pin
Luc Pattyn12-May-09 23:58
sitebuilderLuc Pattyn12-May-09 23:58 
QuestionRetrieving USB Barcode scanner data... Pin
Jacob Dixon12-May-09 14:58
Jacob Dixon12-May-09 14:58 
AnswerRe: Retrieving USB Barcode scanner data... Pin
Mycroft Holmes12-May-09 15:28
professionalMycroft Holmes12-May-09 15:28 
GeneralRe: Retrieving USB Barcode scanner data... Pin
Jacob Dixon12-May-09 15:54
Jacob Dixon12-May-09 15:54 
GeneralRe: Retrieving USB Barcode scanner data... Pin
Luc Pattyn12-May-09 17:12
sitebuilderLuc Pattyn12-May-09 17:12 
AnswerRe: Retrieving USB Barcode scanner data... Pin
Dave Kreskowiak12-May-09 17:19
mveDave Kreskowiak12-May-09 17:19 
GeneralRe: Retrieving USB Barcode scanner data... Pin
Mycroft Holmes12-May-09 19:07
professionalMycroft Holmes12-May-09 19:07 
GeneralRe: Retrieving USB Barcode scanner data... Pin
Jacob Dixon13-May-09 3:06
Jacob Dixon13-May-09 3:06 
AnswerRe: Retrieving USB Barcode scanner data... Pin
cackharot27-May-09 15:03
cackharot27-May-09 15:03 
GeneralRe: Retrieving USB Barcode scanner data... Pin
Jacob Dixon28-May-09 4:17
Jacob Dixon28-May-09 4:17 
QuestionSending file via TCP protocol Pin
nike_arh12-May-09 10:31
nike_arh12-May-09 10:31 
AnswerRe: Sending file via TCP protocol Pin
Luc Pattyn12-May-09 14:11
sitebuilderLuc Pattyn12-May-09 14:11 
GeneralRe: Sending file via TCP protocol Pin
nike_arh12-May-09 23:35
nike_arh12-May-09 23:35 
GeneralRe: Sending file via TCP protocol Pin
Luc Pattyn13-May-09 0:03
sitebuilderLuc Pattyn13-May-09 0:03 

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.