Hi Jay B,
I seldom start a discussion with you and this one is very slippery ground
because I was you did a lot of investigations in the present time.
But with this one I had to think about Toms message to me about
encapsulation.
And this looks me someting for it.
My idea is, that when you have calculations, let say incometax for a
country, it has to be in one class and not a part of an other class.
And especialy not as part form a class (not a supplier) which has a function
in it that can be used in other programs.
My 2 cents, I am prepared to loose this discussion this time.
)
Cor
"Jay B. Harlow [MVP - Outlook]" <
[email protected]> schreef in bericht
Marten,
In addition to the other's comments.
Can you provide more details on what you are attempting to accomplish?
You are correct is not good to copy the code for Calculate into both A & B.
However both can have a method called Calculate that performs a different
calculation based on being either an A or a B object.
In addition to the others comments about Shared & Inherits: If a B object
needs to call the Calculate method of an A object, then B needs either a
class variable of type A, or B's method needs an A object as a parameter.
Again can you provide more details, as I am not following what you want.
Maybe include 10 to 15 lines of code to show what you have now, that you are
trying to avoid.
Hope this helps
Jay