473,321 Members | 1,669 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,321 software developers and data experts.

Overridable Functions/Procedures

Hi,
I was wondering if anyone has any information on the performance impact of
using functions declared as overridable?

To Explain more fully; By default every function created in VB is NOT
declared as overridable. However 90% of the time when creating resuable
components/classes you don't care if the target programmer overrides the item
or not.

However, if you are the target programmer and wish to alter the behviour of
a class in a polymorphic manner and the creator of the class has not declared
the function/property/procedure as overridable then you are stuck with
shadowing the original code... which of course will not operate correctly
(with respect to polymorphism).

So is there any performace reasons (memory/CPU) considerations for not
declaring all of the procedures/functions in a Class as overridable?

Regards,
Myles

Jun 21 '06 #1
2 1369
Making things overridable I'm sure detracts from performance. However, I
would think this performance hit is so small as to be considered completely
inconsequential to the performance of your program.

Making things overridable or not should be done more from the perspective of
software architecture. There are some things that a developer should simply
not be able to override.

Also, from the point of view of readability, it is easier to follow what is
going on in a program and what its intended structure is if only methods
that truly need to be overridable are declared as such.

I think good programming practices should be what you worry about here, and
forget about worrying as to how this will impact performance.

"MDFS" <MD**@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.com...
Hi,
I was wondering if anyone has any information on the performance impact of
using functions declared as overridable?

To Explain more fully; By default every function created in VB is NOT
declared as overridable. However 90% of the time when creating resuable
components/classes you don't care if the target programmer overrides the
item
or not.

However, if you are the target programmer and wish to alter the behviour
of
a class in a polymorphic manner and the creator of the class has not
declared
the function/property/procedure as overridable then you are stuck with
shadowing the original code... which of course will not operate correctly
(with respect to polymorphism).

So is there any performace reasons (memory/CPU) considerations for not
declaring all of the procedures/functions in a Class as overridable?

Regards,
Myles

Jun 21 '06 #2
Hi Marina,
thanks for the input, everthing that you have pointed out makes sense,
however the core question is still what sort of performance hit is taken...
Maybe it's insignificant (and probably is given that I haven't been hit with
loads of reply's)

With regard to "Best Programming Practice" that is what we are trying to
establish for the current and future development requirements :)

From the point of view of re-usable components it would appear sensible that
procedures are declared overridable unless there is a compelling reason not
to (Security, Stability, etc.) however the question that arose was what
impact this would have on performance (memory, cpu etc.)

Again thanks,
Myles.
Regards,
Myles.
Jun 22 '06 #3

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

Similar topics

2
by: JingleBEV | last post by:
Hi all, I am trying not to use global variable to maintain data consistency. Some procedures and functions will require to pass the recordset object for processing and functions may also return...
7
by: BlueDragon | last post by:
The place where I work is moving to MS SQL Server from Lotus Notes. I have done a lot of coding in Lotus Notes, and have, I suppose, intermediate skills in basic SQL -- queries, insert, updates,...
0
by: Zlatko Matiæ | last post by:
Hello. While I was working with Access Projects (Access front-end with MSDE) I was able to call stored procedures by using ADO command and parameters object. Now I am trying to migrate my...
3
by: Anil Gupte | last post by:
Hopefully this list is newbie-friendly. I have a conceptual questions. I am learning VB and came across the description in a book I am using that describes procedures vs. functions. I understand...
5
by: Dilip | last post by:
In a polymorphic hierarchy is it common practice to have public virtual functions in the base class with a default empty implementation and let the derived classes decide whether they want to...
3
by: grawsha2000 | last post by:
Hello, I have an overridable function in a base class (to do some basic database works) that gets inherited by many concrete classes. These concrete classes expands the work of that...
0
by: ddddd | last post by:
AM using the JDBC interface metho getProcedures() to get the stored procedures from the Database... Since this is common interface method am trying out with two different set of databases namely...
1
by: svkreddy | last post by:
Dear All, Please provide the simple information about stored procedures and stored functions in microsoft sql server2005. Please give the information about Nested procedures and nested funtions....
1
by: mansi sharma | last post by:
Functions ia a block of code that performs some task & returns value. Can somebody tell me What are Stored Procedures? I found abt Stored procedues from the Net-->Stored Procedures is a group of...
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...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.