From: dblack@... Date: 2003-11-18T04:07:56+09:00 Subject: Re: Strong Typing (Re: Managing metadata about attribute types) Hi -- On Mon, 17 Nov 2003, Thien Vuong wrote: > - I'm very sure that the this object behaviour/or my need could be > encapsulated fully in this method - so there is no good reason to create > extra code to do needless things. > > This is valid and works much of the time, but does not scale into the > argument that class/module checkin is an inferior/crutchy way to design. > Once the needed object behaviour becomes more complex, class/module > interface is needed to describe that behaviour (of course, respond_to > combination/manipulation could do it too, but we would be trying to > reinvent the wheel against a proven/established system already). The system you're describing -- one-to-one, immutable mapping of methods in a class with methods of which that class's instances are capable -- is only proven and established in languages where it's enforced, which don't include Ruby. What you're saying is sort of like saying: using a keyboard to generate musical notes is proven and established, so let's add keyboards to violins. (Actually it's more like saying: let's play the violin by using its keyboard; to which I say: what keyboard? :-) > I was drawn to ruby because of the OO capability + extra dynamicity > which added to the OO capablity - and it would be a shame to just > embrace the dynamics only and drop the OO. These things aren't at war with each other; it's a dynamic, object-oriented language. I'd advise against looking at the dynamism of Ruby objects as "extra". It's present from the ground up, and goes absolutely straight to the heart of the "type != class" principle in Ruby. David -- David Alan Black home: dblack@wobblini.net # New email address work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav