From: dblack@... Date: 2007-02-18T03:29:22+09:00 Subject: Re: Oppinions on RCR for dup on immutable classes Hi -- On Sun, 18 Feb 2007, Stefan Rusterholz wrote: > Yukihiro Matsumoto wrote: >> Hi, >> >> In message "Re: Oppinions on RCR for dup on immutable classes" >> on Sun, 18 Feb 2007 01:37:19 +0900, Stefan Rusterholz >> writes: >> >> |Um, no, with the classes mentioned in the RCR the answer would be >> |"never", not just "today". You'd have to buy the Restaurant and exchange >> |to cook to change the answer :) >> >> If we see a class as a restaurant, your illustration makes sense. But >> from my point of view, we don't know the name of the restaurant, nor >> its menu. We just sit and cry for "Spaghetti!", and sometimes the >> waiter says "I'm sorry". >> >> matz. > > The example translates to: > Restaurant := Class > Menucard := #methods > Say "we don't serve that" := raised Exception But methods are not constrained by class. It's not the class's responsibility to oversee the object's methods. I'm not sure where the object fits into your model. David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)