From: Robert Klemme Date: 2007-09-13T17:59:29+09:00 Subject: Re: Singleton Modules rather than Singleton Classes 2007/9/12, Trans : > > > On Sep 11, 1:55 am, "Robert Klemme" > wrote: > > > I'd generally prefer to define modules explicitly and extend classes > > with them as Ara suggested. IMHO that's a cleaner way to achieve what > > you want and it also documents things more nicely (especially you can > > look at inheritance etc.). My 0.02EUR > > That is simply not correct. Fist of all, you do not control all code, > so you can not make someone else modularized their module's class- > level methods, so you can later augment them with meta-code. I'm not sure. If they are not modularized I probably would not want to reuse them. > Secondly, > the primary point has nothing to do with the fact that one can manage > workarounds, of course there are ways, but b/c of limitations they are > fragile and inefficient. I don' t think inheriting (as show in my first reply) is fragile or inefficient but I may of course get in the way with other inheritance you'd want to do. > Lastly, you are missing the point when you > you say, "prefer to define modules explicitly... that's a cleaner way > to achieve what you want". That's not the issue. Again, I encourage > you to have a look as Facets' inheritor.rb lib to get a better > understanding of this. Um, you got me stumped here: in your original post you advertised easier reuse of singleton methods by making the singleton class a singleton module instead. Where exactly am I missing the point? Kind regards robert