Re: Is this good programming?
Re: Is this good programming?
- Subject: Re: Is this good programming?
- From: j o a r <email@hidden>
- Date: Thu, 23 Aug 2007 14:00:20 +0200
On 23 aug 2007, at 13.24, Frank Bettger wrote:
I'm a newbie so maybe I'm thinking wrong but the code above seems
dangerous
to me and opposes the OOP saying that the only way to change an
instance
variable of an object should be by calling one of objects methods.
The code you quoted use a setter method to change the instance
variable, so I don't quite see your point.
If this class has instance variables that some external client
shouldn't be able to modify, it shouldn't expose public setter
methods. As there in this case is a public setter method (I didn't
check the book so I just assume that there is), you would expect that
it in general is OK to call it.
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden