• 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: Another controversial question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Another controversial question


  • Subject: Re: Another controversial question
  • From: Drew McCormack <email@hidden>
  • Date: Sun, 2 Sep 2001 13:33:11 -0700

Thanks to all who responded. I think I get it fully now.

I hadn't realized that key-value coding would actually call the accessor method if it were present. This changes things dramatically. It actually isn't really a serious violation of encapsulation, just a means of automatically writing accessor methods. If all an accessor needs to do is directly return an attribute, key-value coding can take care of it. If the required behaviour is more elaborate, an accessor can always be written, and that will be called. Importantly, an accessor method can always be added later if the implementation is to be changed, and the rest of the code will be unaffected. This last point is what distinguishes direct access of member attributes from key-value coding.

Pretty cool actually. Thanks again.

Drew McCormack


  • Follow-Ups:
    • Re: Another controversial question
      • From: Chris Kane <email@hidden>
    • Re: Another controversial question
      • From: Chris Gehlker <email@hidden>
  • Prev by Date: Re: Datasource for tableview and more
  • Next by Date: Re: Math question
  • Previous by thread: Re: Another controversial question
  • Next by thread: Re: Another controversial question
  • Index(es):
    • Date
    • Thread