From: "David A. Black" Date: 2008-07-21T21:37:48+09:00 Subject: Re: protected members or explicit abstract classes? Hi -- On Mon, 21 Jul 2008, Robert Dober wrote: > Short answer: > Because Ruby is not Java > > Long answer: > Ruby just has a different way approaching object oriented > programming. I believe that it is a more agile > approach, and that abstract classes do not fit into Ruby's paradigm at all. > > Very long answer: > As a matter of fact I believe that Ruby should not even have > classes, class and type rhyme too strongly. > I have developed different ways of doing object oriented > development in Ruby (traits, prototypes, pushable behavior) all of > them very slow, unfortunately. I really do not remember when I wanted > an abstract class or a > protected member last when developing in Ruby. I am still guilty of > some code like "if String === s" but I > hopefully one day will replace this with "if s.behaves_like? StringBehavior". You could do that with const_missing :-) (I know there's more to it than that.) > Therefore the quintessence of my reply is, do Ruby, do ducktyping > and ask yourself the question in some > months time from now again! For true duck typing you would just do: s.the_method and live with the consequences :-) David -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails July 21-24 Edison, NJ * Advancing With Rails August 18-21 Edison, NJ * Co-taught by D.A. Black and Erik Kastner See http://www.rubypal.com for details and updates!