Re: Private, Protected methods in Obj C?
Re: Private, Protected methods in Obj C?
- Subject: Re: Private, Protected methods in Obj C?
- From: Ondra Cada <email@hidden>
- Date: Thu, 4 Apr 2002 00:14:50 +0200
On Thursday, April 4, 2002, at 12:04 , Jonathan Wight wrote:
Actually they can -- a static function is just a private, non-inheritable
method in fact ;)
You just have to use self explicitly (as an argument) to access
properties.
Yeah and while we're at it who needs these object things anyway? Let's
just
use functions. I propose we call this language "Non-Objective C", or just
"C" for short. Catchy name yes? ;-)
Static functions should be used inside a class only as a method of last
resort. If you use them you sacrifice all of Objective C's dynamic
loveliness. Dont do it. If you need (mostly) private methods put them
inside their own hidden categories.
I guess one of us two does not know what a "private method" is (might
easily be me -- I have never been an expert in those C++ thingies!).
Anyway:
- is it inheritable?
- is it overridable?
I guess twice nope. A *private* method -- or what I understand a private
method is -- is really nothing but a static function, in C++ with a
convenient access to properties. NOTHING MORE (or is it?). Since no
dynamic loveliness is *POSSIBLE BY DEFINITION* with a private method, why
should we care in the implementation?
Don't take me wrong: I *DO* advocate using the dynamic runtime whenever
appropriate, for all those reasons of stability, flexibility, robustness,
upgradability, and you-name-it. But so far as I understand, privateness
means a very categorical "I don't want any of that!".
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.