From: Madan Manoharan Date: 2006-05-28T02:47:22+09:00 Subject: Observer pattern ... ------=_Part_39948_20425781.1148752039946 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello: I am using the observer pattern that comes with the standard Ruby distribution and found that the publisher allows the same observer to be 'added' more than once. code from observer.rb def add_observer(observer) @observer_peers =3D [] unless defined? @observer_peers unless observer.respond_to? :update raise NoMethodError, "observer needs to respond to `update'" end @observer_peers.push observer end I was wondering if it would make sense to change the last but one line in method 'add_observer' to @observer_peers.push observer if not @observer_peers.include?(observer= ) In other words, am I missing an obvious reason for a publisher to allow an observer to register more than once? Thanks, Madan. ------=_Part_39948_20425781.1148752039946--