Re: changing access modifier of base method



Fredo wrote:

Why are you trying to hide the methods? Maybe there's another way to handle your problem.

The object is dialogue, so ShowDialog should be used at all times, it makes no sense to call Show. On top of that I overloaded ShowDialog to initialize the title and prompt in the InputBox, so, in fact I would like to hide the base ShowDialog as well.

Once again, I disagree with the hard-line definitions of OOP. I see no philosophical reason to disallow changing access modifiers on base methods, especially in this case where the base is a general purpose class and the derived is a specialization of the base. But I guess that's just me. The argument that there is nothing stopping the user from casting to Form and calling Show is, in this case, invalid, kind like saying, in C++ that you can change the value of a reference, sure you can, but who in their right mind ever would.

Anyways, as for this class, the purpose of hiding the methods is for completeness, no one will ever use them and it's kind of an annoyance to see them in intellisense.
.


Loading