RE: accessor question
RE: accessor question
- Subject: RE: accessor question
- From: "Mondragon, Ian" <email@hidden>
- Date: Thu, 27 Feb 2003 16:08:48 -0600
Koen,
This should all depend upon what you need your program to do: do you
*need* it to be a more real-time oriented program? If, for instance, you're
dealing with a visual item, such as a window, and setting a coordinate,
chances are that you are going to want the window to update accordingly
ASAP, which might call for the set method to call additional methods in
order to achieve this. Otherwise, I'd personally stick with the die-hard
one-tool/method-for-one-job-only philosophy.
Just my $0.02.
- Ian
>
-----Original Message-----
>
From: Koen van der Drift [SMTP:email@hidden]
>
Sent: Thursday, February 27, 2003 2:15 PM
>
To: email@hidden
>
Subject: accessor question
>
>
Hi,
>
>
Just curious, is it considered good programming practice to add some
>
code to an accessor that tells an object to update itself, for
>
instance:
>
>
-(void)setMyValue:(float)aValue
>
{
>
myValue = aValue
>
>
[self recalculate];
>
}
>
>
>
If not, would this be an alternative:
>
>
...
>
[myObject setMyValue:1.23456];
>
[myObject recalculate];
>
...
>
>
>
thanks,
>
>
- Koen.
>
_______________________________________________
>
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.
_______________________________________________
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.