473,320 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

NotOverridable = still overloadable?

Is there any way to make a sub/function that you can neither override nor
overload? I cant seem to find any information on blocking the ability to
overload a function in a derived class..

Any help is appreciated,

Rick
Nov 21 '05 #1
4 1074
Rick,
| Is there any way to make a sub/function that you can neither override nor
| overload?
As you know, you can use NotOverridable to prevent a method from being
overridden, however you cannot prevent overloading.

Just out of curiosity, what do you think not overloading is going to buy
you?

Hope this helps
Jay

"Rick Mogstad" <Ri**********@GMail.NOSPAM.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
| Is there any way to make a sub/function that you can neither override nor
| overload? I cant seem to find any information on blocking the ability to
| overload a function in a derived class..
|
| Any help is appreciated,
|
| Rick
|
|
Nov 21 '05 #2

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Rick,
| Is there any way to make a sub/function that you can neither override
nor
| overload?
As you know, you can use NotOverridable to prevent a method from being
overridden, however you cannot prevent overloading.

Just out of curiosity, what do you think not overloading is going to buy
you?


Its really to prevent another developer from overloading the function and
then complaining when it doesnt do what its supposed to. And its not really
my question, it was asked of me, and I didnt know the answer. So i guess I
dont know the whole reason, but I know that its more to prevent it so that
it will not confuse rather than that it will cause any actual harm.

Nov 21 '05 #3
Rick,
If "preventing" overloading was important, as you indicate they can be
"confusing" for some developers. You could always use or create a tool such
as FxCop with a rule that indicates that overloaded functions are bad. Then
use the tool as part of your code reviews.

I personal find overloading to be a very powerful & useful tool when writing
programss.

Hope this helps
Jay

"Rick Mogstad" <Ri**********@GMail.NOSPAM.com> wrote in message
news:u7**************@TK2MSFTNGP14.phx.gbl...
|
| "Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
| news:%2***************@TK2MSFTNGP15.phx.gbl...
| > Rick,
| > | Is there any way to make a sub/function that you can neither override
| > nor
| > | overload?
| > As you know, you can use NotOverridable to prevent a method from being
| > overridden, however you cannot prevent overloading.
| >
| > Just out of curiosity, what do you think not overloading is going to buy
| > you?
| >
|
| Its really to prevent another developer from overloading the function and
| then complaining when it doesnt do what its supposed to. And its not
really
| my question, it was asked of me, and I didnt know the answer. So i guess
I
| dont know the whole reason, but I know that its more to prevent it so that
| it will not confuse rather than that it will cause any actual harm.
|
|
|
Nov 21 '05 #4

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:ei*************@TK2MSFTNGP09.phx.gbl...
Rick,
If "preventing" overloading was important, as you indicate they can be
"confusing" for some developers. You could always use or create a tool
such
as FxCop with a rule that indicates that overloaded functions are bad.
Then
use the tool as part of your code reviews.

I personal find overloading to be a very powerful & useful tool when
writing
programss.

Hope this helps
Jay

We use overloading heavily, we just want to prevent a derived class from
overloading a method that is not overridable in the base class.
Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: greg | last post by:
Discussion is invited on the following proto-PEP. ------------------------------------------------------------- PEP ??? - Overloadable Boolean Operators...
3
by: Marina | last post by:
Hi, I have a class that inherits from CollectionBase, and I'm trying to override its Count property. As per the documentation, this property is overridable - so I should be able to do this. So...
3
by: Marina | last post by:
Hi, I have a class that inherits from CollectionBase, and I'm trying to override its Count property. As per the documentation, this property is overridable - so I should be able to do this. So...
1
by: sonia.sardana | last post by:
First of all I want to ask dat,is it a valid keyword. I have read it from MSDN help. NotOverridable means that if we declare a method in base class with keyword NotOverridable , we cannot override...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.