discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dia2code objc


From: Frederic Stark
Subject: Re: dia2code objc
Date: Tue, 26 Mar 2002 18:03:35 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.8) Gecko/20020204

Richard Frith-Macdonald wrote:

[...]



perhaps this can be done without changing the compiler, by using an
authentication mechanism like the one in NSProxy. the accessor methods could check whether the caller is allowed to access the variable, we can even have write only and read only access and different access rights for different
classes, try that with c++ ;) .


IMO getting very complex/sophisticated about this is a waste of programming effort and produces confusing code. Access restrictions cannot be enforced, so sticking to simple conventions is more effective.

Oh, yes, yes and yes.

My two cents on the issue:

* public methods are delcared in the main header
* protected methods are declared in a separate category (which can be put in its own file) * private methods are declared in a category located at the start of the .m and implemented at the end.

(To be frank, I have much more categories than that on a class, like one category per superclass from which methods are overriden, on category per informal protocol implementation, one per protocol implementation, one for primitive methods, etc, etc)

Cheers,

--fred





reply via email to

[Prev in Thread] Current Thread [Next in Thread]