Saikat Chakrabarti <[email protected]> writes: > I think I understand what you are saying, but I just want to make > sure. You are saying that instead of trying to define a view for the > datalist widget to display the list how I want, it would probably be > easier to just write my own list widget that has a render-widget-body > that does what I want? But doesn't this make the code somewhat > redundant/break the abstraction of views from widgets? Why even have > views as a feature in the language?
Your comments are spot on. Views are a good idea, but IMHO in the current implementation they aren't that useful. I think the problem is that they try to do too much -- instead of just being a mapping from the data model to widgets, they also implement some of the widget functionality (like rendering), some controller functionality (form processing), but they aren't really first-class citizens. My idea to fix this is roughly as follows: 1) make presentations be widgets, with an additional presentation interface, 2) reduce views to maps between data model and presentations, 3) make views usable only from widgets (e.g. you have to use formview or something similar, you can't just call render-object-view. That way presentations would be first-class citizens (with dom-ids, being on the children list, etc) and could participate in flows. Views could still be stateless data maps, as (I think) they were intended to be. And they could be instantiated as many times as one wishes. Plus, we could keep the existing view infrastructure: view combining, inheritance, scaffolding. Comments welcome. I began working on this, but progress has been slow so far. --J. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "weblocks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/weblocks?hl=en -~----------~----~----~----~------~----~------~--~---
