Peter Donald wrote: > > I have a kinda different view. IMHO all GUI apps should be designed to be > passive - only respond to events. Whether the initiater of these events is a > user, a database or whatever should be irrelevent. > > Unfortunately this is rarely the case - most GUI apps put their logic inside > their event handlers (ug) rather than separating it into separate logic > components. Because of this the view code becomes so interwoven with the > logic most people assume it has to be this way ;(
I believe you're saying that instead of responding to XML data the GUI could also respond to events and that would be an equivalent model of a data-driven application. I think that is correct in specific cases, but consider the content of events and XML data. An event is something like "Button 3 pressed" or "Pull-down menu 1, item 4 activated" - an inherently layout-oriented process. If I write XML that encodes these events, then that's just a matter of putting angle brackets around the events. In that case there is a conceptual equivalency between events and XML data. However, I think that XML data makes it possible to use a semantically richer event content that is not layout-oriented, but data-oriented. Then, every time I change the data model, the GUI would adapt automatically. Spreadsheets like Excel are a simple example of this. If you change the data model (e.g. by adding rows or columns) the GUI automatically changes and gives you standard buttons to manipulate the new rows and columns. Once I've seen a desktop database, where you could say "If this db field has a value, then display a button, if it is empty, then don't". Ulrich -- Ulrich Mayring DENIC eG, Systementwicklung -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>