From: David Alan Black Date: 2002-04-19T22:45:20+09:00 Subject: Re: Replacing groups of methods: How would *you* do this? Hi -- On Fri, 19 Apr 2002, Hal E. Fulton wrote: > Question for you. > > There is more than one way to do what > I am wanting to do. Probably the "right" > way is one I haven't thought of yet. > > Suppose I have a class where I consider > a number of methods "pluggable" or > "disposable." (If you're curious, these are > UI-oriented; I'm writing an app with alternate > user interfaces.) > > At first I thought: I'll make a module with the > methods in it, then include it at runtime if/when > I choose to. > > But then I realized that module instance methods > don't replace class instance methods. Hmm. > > So I thought: I can write replacement methods > in the same class and put them in separate > files which I then include. > > But I don't really want to use separate files. > > What do you think? Could you do conditional execution? if condition class Thing # redefine methods end end David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav