PDA

Click to See Complete Forum and Search --> : class inheriting


PT Exorcist
Apr 23rd, 2003, 01:18 AM
i have a program that has ClassD that inherits from classC that inherits from classB that inherits from classA..when i use classA it will be slower than a non-inheriting exactly the same class just because it is inheriting from another class that is inheriting too and that way? or not?

VBCrazyCoder
Apr 23rd, 2003, 07:50 AM
I don't think that speed would be an issue unless you are inheriting lots of methods, etc. that you wouldn't even use - but that goes against the principles of inheritance anyway.

In your example, ClassA is the root of your inheritance structure, so ClassA that is inherited from, and a ClassA that is not inherited from should have the same performance.

For your other classes that do inherit from other classes, again - I don't think that speed would be that much of an issue, and I would think that the benefit of code reuse would be of more value.