From: Jim Freeze Date: 2002-09-17T00:50:46+09:00 Subject: Re: not grasping the method overloading/multi-dispatch thing On Mon, Sep 16, 2002 at 11:11:14PM +0900, Philipp Meier wrote: > On Sat, Sep 14, 2002 at 08:03:10AM +0900, Patrick May wrote: > > Philipp Meier wrote in message news:<20020913101910.GC17997@o-matic.net>... > > > On Fri, Sep 13, 2002 at 02:22:25PM +0900, Patrick May wrote: > > > Coming from a java background if do not feal comfortable with Mixins, > yet. Altough I must admist this a clever use of them. Nevertheless I fear > a clash of method names if more than a few mixins are used on business > methods. Imaginge you want to extend to example by a to_xml method. > Accidently you name the tag method "tag" like the one for HTML. (Assume > the XML aspect is defined in another place than the HTML.) This could > lend to real confusion, IMHO. I know, I know there are Unit Tests that > should catch this but I stell consider it a slight smell. One would be > on the safe side, if one could tell to call the method defined in a > certain module: > We prevent this at our corporation by having a top level module for our company and, the larger projects have their own namespace as well. See the (what may be bad) example below: ------ module Cypress module BigProject module Math def sin(x) end#sin end#module Math end#module BigProject end#module Cypress --- So, there is no confusion between Math::sin(x) and Cypress::BigProject::Math:sin(x) or include Cypress::BigProject::Math sin(x) -- Jim Freeze ---------- Programming Ruby def initialize; fun; end A language with class