P
Pavils Jurjans
Hello,
I wanted to get some feedback on why there are not allowed virtual static
members in C#.
Say, I have the Parent class, that hosts number of protected methods, that
occasionaly make calls to the virtual methods. When I create the Child
class, inheritting from the Parent class, and declare all of the Parent's
virtual methods with 'override', so that when these methods are called from
within the Parent protected methods, they would use the code that's in the
Child class.
Now, why should I be not allowed to have similar pattern with static
methods - If I have an instance of the Child class, and I call this
protected metjhod whose code is defined in the Parent class, and this code
makes call to this static method, why can't I override the static method
that is called in this scenario, so that the code that resides in the Child
class is called?
Rgds,
Pavils
I wanted to get some feedback on why there are not allowed virtual static
members in C#.
Say, I have the Parent class, that hosts number of protected methods, that
occasionaly make calls to the virtual methods. When I create the Child
class, inheritting from the Parent class, and declare all of the Parent's
virtual methods with 'override', so that when these methods are called from
within the Parent protected methods, they would use the code that's in the
Child class.
Now, why should I be not allowed to have similar pattern with static
methods - If I have an instance of the Child class, and I call this
protected metjhod whose code is defined in the Parent class, and this code
makes call to this static method, why can't I override the static method
that is called in this scenario, so that the code that resides in the Child
class is called?
Rgds,
Pavils