• 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: subclassing NSMutableArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: subclassing NSMutableArray


  • Subject: Re: subclassing NSMutableArray
  • From: Nathan Day <email@hidden>
  • Date: Sun, 4 Aug 2002 12:47:46 +0930

NSMutableArray is a cluster class and subclassing it is difficult, subclassing is considered bad practice because it ties your class in tightly with the class you are subclassing, if could change the implementation in some way that could break you code, subclassing is if you need to change the behavior of a class, as a consequence NSMutableArrays aren't really designed with subclassing in mind. If you want to subclass then you will have to read up on cluster class in the Apple docs.

On Sunday, August 4, 2002, at 01:54 AM, brian lee dae yung wrote:

You need to brush up on the difference between is-a and has-a
relationships in object-oriented design.

Your MxPriceSeries class probably shouldn't be a subclass of
NSMutableArray; rather, it should have an instance variable of type
NSMutableArray.

Hi, thanks for your distinction between has-a and is-a. Although i
could use a has-a relationship, i consider it to be a great kludge of
an implementation. As much as i would enjoy discussing you the
idiosyncracies of my decision to use inheritance versus composition, i
am more interested in understanding why i cannot successfully sub class
NSMutableArray. Any insights to that extent are appreciated.


Nathan Day
http://homepage.mac.com/nathan_day/
_______________________________________________
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.

References: 
 >Re: subclassing NSMutableArray (From: brian lee dae yung <email@hidden>)

  • Prev by Date: Re: Click-through windows
  • Next by Date: Re[3]: InfoPlist.strings
  • Previous by thread: Re: subclassing NSMutableArray
  • Next by thread: Re: Accessing "current document" when not the frontmost application
  • Index(es):
    • Date
    • Thread