From: patrick-may@... (Patrick May) Date: 2002-07-23T15:26:00+09:00 Subject: Re: GUI's and the Rouge, Part II Ned Konz wrote in message news:<200207201125.13528@ned.bike-nomad.com>... > On Saturday 20 July 2002 10:00 am, Tom Sawyer wrote: > > we can think of it like this: instead of widget.displays(x) > > we get x.widgetized. This ties into a discussion I was having about coding and testing html -- that it's better to use widgets to make html easier to test, not to prevent you from having to write html. i.e., instead of writing: Form:Text.new( "name", "default name", :size => 30; :maxlength => 40 ) Form:Pass.new( "password", "", :size => 30; :maxlength => 40 ) to replace Name: Pass: You have: Login.form # => outputs the above html which we thought of as an application specific widget containing the two form elements. The goal here would be to break the presentation into "widgetize" methods that make it easier to test the html. However, this isn't something that would the basis for a library. These widgets need to be as general as possible to be useful, instead of GUI widgets which are made to be as flexible as possible. I guess the goal is to code for reuse within your application, not for reuse outside of your application. > The main problem with this is that the data shouldn't have to know > about how it's going to be presented. > > When you want to display something on (say) a PDA, you might choose to > have different representations (shorter strings, no colors, etc.). I think it's rare that you would want the same application on a PDA and a desktop. The limitations of a PDA go beyond the size and color depth of the framebuffer; there are also major input considerations. In a MVC architecture I don't see much benefit to sharing the the view or controller code between dramatically different platforms (unless the problem is dramatically simple, such as a calculater). ~ Patrick