discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Setter Gettor method style


From: Pascal Bourguignon
Subject: Re: Setter Gettor method style
Date: Sun, 4 Aug 2002 16:32:32 +0200 (CEST)

> Date: Sun, 4 Aug 2002 04:33:44 +0200
> From: Martin =?iso-8859-1?Q?H=E4cker?= <mhaecker@mac.com>
> 
> >Agree.  But the case where the difference matter would not occur in my
> >book because I have the rule to retain all objects I need:
> >
> >      NSString* title=[[stuff title]retain];
> >      [stuff setTitle:newTitle];
> >      NSLog(@"old title was %@\n",title);
> >      [title release];
> >
> >In my  little mind, it's simplier  to have simple rules  to be applied
> >always without exceptions.
> 
> I am not completely sure of that, but as I understand it the Cocoa 
> Engineer (Ali Ozer) told this pattern because of the "Foundation 
> Contract" as he called it, that every object you get from the 
> foundation should be valid for the scope of the method it was got in.

Why not, if only all these "Contracts" were documented somewhere...
 
> This aside as a user of a class I also like this pattern a bit 
> because it makes me type less.. although that is probably a bad 
> excuse and should not lead my way.


-- 
__Pascal_Bourguignon__                   http://www.informatimago.com/
----------------------------------------------------------------------



reply via email to

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