-
Inheriting visibility
is just like in c++ possible to declare the objects of the form we're inheriting from private? like
class myClass : private myMotherClass {
}
i dont think it is possible but if it someone could point me how? i think it's a big lack .net don't support that :\
-
hmm when trying it in c++.net i saw the answer to my question:
managed classes only support public inheritance
-
It's a nice feature of C++ but to be honest I've used it only once - what do you need it for?
-
imagine u have a complex control and u want to make it easier..u could for example inherit from it, create methods that would turn it easier and the old ones would be hidden
-
That's against OOP philosophy. Write a class that contains a private member of the complex class and add methods to call through.
-
yeah i've though about that but..i think it would be nicier with private inheritance..anyways why is that against OOP philosophy? and also what did u do the only time u did private inheritance?
-
Can't remember what I did.
OOP philosphy says that a derived class may add functionality or change functionality, but not hide functionality.
-
ah..i see then..
ps: i mailed the support ms' C# guy and talked about private inheritance and he replied saying that he liked the idea and was going to talk to the other guy about that
-