• 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 encapsulation deprecated in ObjC?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is encapsulation deprecated in ObjC?


  • Subject: Re: Is encapsulation deprecated in ObjC?
  • From: Chris Gehlker <email@hidden>
  • Date: Fri, 17 Aug 2001 12:41:01 -0700

On 8/16/01 11:51 AM, "Charles Jolley" <email@hidden> wrote:

> BTW, I remember reading some old documentation several years ago stating
> that one should create accessor methods for all ivars subclasses might
> want to access to help limit the "fragile base class problem." If you
> change the implementation of your class in such a way that a given ivar
> is no longer used, you can still provide accessors for that ivar that
> calculate the value by some other means. Thus, subclasses will "just
> work" without having to be modified.

OK, there is at least some rationale for creating public accessors for
everything. Thanks for explaining that. I wish learning Cocoa would take a
few paragraphs to explain the reasoning behind this and some of the other
rules that they present in a "do this" fashion.

I have to say that I don't find this reasoning very compelling. If I don't
need an accessor in a base class, the chances are slim that I'll need it in
a descendant of that class. If I do, it's probably time to rethink my
design.
--
In the midst of great joy, do not promise anyone anything. In the midst of
great anger, do not answer anyone's letter. -Chinese proverb


References: 
 >Re: Is encapsulation deprecated in ObjC? (From: Charles Jolley <email@hidden>)

  • Prev by Date: Re: Enabling/Disabling Buttons
  • Next by Date: RE: Downloading html page
  • Previous by thread: Re: Is encapsulation deprecated in ObjC?
  • Next by thread: RE: Is encapsulation deprecated in ObjC?
  • Index(es):
    • Date
    • Thread