From: Micah Martin Date: 2007-07-06T07:57:46+09:00 Subject: Re: Calling an arbitrary method as and when an array's contents change Great. Houlihans is quiet enough for us to talk. 5:00pm work for you? Sent from my iPhone On Jul 5, 2007, at 5:26 PM, MenTaLguY wrote: > On Fri, 6 Jul 2007 07:13:31 +0900, "Dan Stevens (IAmAI)" > wrote: >> I have a collection class that extends the Array class and I wish to >> have a particular method to be called whenever the contents of an >> instance of the class change. Can anyone advise on how I can achieve >> this? > > For this purpose, it's probably better to wrap/delegate to Array > than extend it. > > That way, you can have control of all the methods that change > something, and > guarantee that they will perform the appropriate notification. I'd > also > recommend looking at Observer for the notification of the equation. > > -mental > >