From: Stephen Lewis Date: 2003-07-16T08:04:53+09:00 Subject: Re: Issues in pluggable user interfaces On Wed, 16 Jul 2003 01:24:46 +0900 "Hal E. Fulton" wrote: > ----- Original Message ----- > From: "Stephen Lewis" > To: "ruby-talk ML" > Sent: Tuesday, July 15, 2003 7:47 AM > Subject: Re: Issues in pluggable user interfaces > > > > (advance warning, I ramble on at great length - sorry :) > > Stephen... > > Food for thought! I can already feel my brain getting fatter. > > The message-passing trick is interesting. But it occurs > to me that if you can pass a message to something, you > can call a method on it. Right? In fact, the method is > a message. (Sounds like Marshall McLuhan.) Hmm, this is a very good point. Yes, at this stage everything that you could pass a message to, you could call a method on. I think I had good reason at the time not to do this however (I'll summarize those I can remember :) - I had paranoid memories of systems where every call to the UI toolkit must originate from one thread - calling methods would therefore still require queuing tasks for that thread to run - using event communication seemed a more general solution. I don't think this is much of an issue with ruby's thread model, but I wasn't sure at the time. - I didn't want the backend OR the ui to block - calling a method that did anything significant would cause this, so I opted for the fully asyncronous approach. - I originally had some visions of spawning separate processes, so I wanted something that might be easier to dump over a pipe (maybe to processes written in other languages (heresy!? ;) ). - I also had some thoughts of programmatically generating documentation and interface information for automation using the events. Since they're separate classes its easier to get them to register themselves and their data somewhere. With methods I thought it would be more difficult to extract 'event' methods, and associated data. (This was an AppleScript inspired feature, but is still on the TODO list) -- Stephen Lewis slewis@paradise.net.nz