From: ilan berci Date: 2006-03-14T01:05:04+09:00 Subject: Re: abstract method in Ruby A good portion of the GoF patterns rely on abstract methods (visitor, abstract factory, template method, etc... ) which IMO only shine in statically typed languages. It would be a shame to port all patterns (and their required prerequisite: abstract methods) simply because they are recognized in the static world and therefore would make a good fit in Ruby. The additional code needed for the ruby "abstract method" approach doesn't make the code any more readable. The extra LoC actually slows down the maintenance developer as she has to wade through more. In both solutions, an exception is thrown at runtime. The abstract method approach will not allow the developer to catch it any earlier than the duck typed default. The exception proposed although slightly more readable will not in practice add any value as Ruby developers are used to seeing the exception and can narrow in on it expediently. We should simply rejoice in the power of the mixin and realize that the abstract specifier was devised prior to (and probably due to the absence of) this incredibly powerfull construct. Lastly, the code becomes somewhat heavier which violates 2 key principles of Ruby, one being the enjoyable to code principle, and the other, least surprise principle. ilan -- Posted via http://www.ruby-forum.com/.