From: Ron Jeffries Date: 2002-04-19T22:49:02+09:00 Subject: Re: Replacing groups of methods: How would *you* do this? On Fri, 19 Apr 2002 12:43:40 GMT, "Hal E. Fulton" wrote: >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? Why not the Strategy pattern? Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com I'm giving the best advice I have. You get to decide whether it's true for you.