discuss-gnustep
[Top][All Lists]
Advanced

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

Re: dia2code objc


From: Richard Frith-Macdonald
Subject: Re: dia2code objc
Date: Tue, 26 Mar 2002 14:14:55 +0000

On Tuesday, March 26, 2002, at 01:47 PM, Björn Gohla wrote:

On Tuesday 26 March 2002 13:41, Philippe C.D. Robert wrote:
Hi!

On Tue, 26 Mar 2002, [utf-8] Björn Gohla wrote:
i am working on a dia2code plugin for objective-c. i have some issues
with class member visibility. public attributes are represented in objc via a set/get pair, and private ones by the absence of it. but is there
any useful interpretation of protected attributes, if so how? how can
private and protected methods be represented in objc?

Cool idea, I am very interested in such work!

In ObjC you can only make variables protected, private or public, but not

but how do we protect a member variable, assuming 'protected' means that the
variable is only accessible by certain objects? i was hoping there was a
simple default way to check whether a calling class is a 'friend' allowed to access protected members, or perhaps this could be a chance to check wether
that would be useful a concept to have in gnustep.

There is nothing equivalent to 'friend' in ObjC ... 'protected' restricts
access to the class and any derived classes, while 'private' restricts
access to the class itsself.

In fact, any class can access anything via the runtime anyway - ObjC is
really quite permissive, depending on conventions for encapsulation more
than specific language features.

The language even provides the @defs() directive, by which you can get direct
access to ivars even if they are private.

I think that providing lots of facilities for access control is a bad thing in a language ... If the language supports pointers and type casting, you can always
work round any protection anyway!




reply via email to

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