From: Oliver Bandel Date: 2006-08-22T08:05:06+09:00 Subject: Re: Strategy pattern / interface design arrangement Rick DeNatale wrote: [...] > > Had Ralph pushed a bit harder, the book might well have abstracted > some of those concepts to duck types (Smalltalk had them, but I can't > recall that we used THAT name, it was most often roles or something > else > http://talklikeaduck.denhaven2.com/articles/2006/07/26/my-favorite-duck-typing-story > > ), and folks might look on both the GOF patterns, and languages like > Ruby and Smalltalk in a different light. A while ago I heard about duck typing. I didn't have used Ruby at that time.... I started programming Ruby about three days ago... and now look at this group.... ...and again find this "duck type". The things I read about it ("duck typing") when I first had contact to this item seem to be very similar to type polymorphism of functional languages.... look at OCaml or haskell for example. But maybe this analogy is not quite right... ...so if someone is here who can explain it better... ...if not, after jumping into Ruby more detailed, I may do it later. Some words about the Patterns: People often think it must be necessary to use them in a language and then all is ok. But the patterns are like a cooking recipe, for meals that - sometimes - are ordered by the hungry people. But even if theses meals maybe are ordered in some situations very often, not all people want to eat them always. They can be used if they are necessray, but why to insist on using them?! Well, someone here who can copmpare duck typing of OO-languages/Ruby and type polymorphism of FPLs? They seem to be similar or the same?! Ciao, Oliver