• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is this good programming?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Is this good programming?
      • From: "Frank Bettger" <email@hidden>
References: 
 >Is this good programming? (From: "Frank Bettger" <email@hidden>)

  • Prev by Date: Re: Informing one class about another class's methods
  • Next by Date: Re: Informing one class about another class's methods
  • Previous by thread: Is this good programming?
  • Next by thread: Re: Is this good programming?
  • Index(es):
    • Date
    • Thread