discuss-gnustep
[Top][All Lists]
Advanced

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

Re: dia2code objc


From: Björn Gohla
Subject: Re: dia2code objc
Date: Tue, 26 Mar 2002 14:36:15 +0100

On Tuesday 26 March 2002 13:36, Helge Hess wrote:
> 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?
>
> Actually private/protected/public attributes should probably be mapped
> to instance variables ? ivars do support those flags:
>
> @interface MyClass
> {
> @private
>    id myPrivate;
> @protected
>    id myProtected;
> @public
>    id myPublic;
> }
> @end

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++ ;) .

> > how can private and
> >
> > protected methods be represented in objc?
>
> There is no protection for methods in ObjC. Common convention is, that
> private and protected methods have an "_" underscore prefix. "Protected"
> might be mapped to a "MyClass+Protected.h" headerfile which contains an
> informal protocol for the protected _ methods.




reply via email to

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