Only one overload of CanReadProperty is Overridable?

Only one overload of CanReadProperty is Overridable?

Old forum URL: forums.lhotka.net/forums/t/1153.aspx


BBM posted on Thursday, September 07, 2006

Does anybody know why the function CanReadProperty(ByVal propertyName As String) in BusinessBase is Overridable, but the other two overloads of the same function are not?

Is this an oversight in BusinessBase, or is there a good reason for this to be this way?   I can still write "Overloads" functions in BusinessBase derived classes with the same signatures and will do so unless there's a good reason not to.

Thanks.

BBM

 

SonOfPirate replied on Thursday, September 07, 2006

This is a common practice when overloading functions to provide different signatures (e.g. argument lists).  Typically all of the overloads will defer to a single method that actually performs the work.  This is the method that you would want virtual/Overridable so that derived classes can implement their own method.  Since the other methods do nothing but call this one, there really is no benefit to overriding them.

Hope that helps.

BBM replied on Thursday, September 07, 2006

Thanks, that makes sense.

Hey, I guess I should look at the code first next time!

Thanks again.

BBM

 

Copyright (c) Marimer LLC