From: Mat M. <mm...@em...> - 2006-10-18 05:39:27
|
Hi Foster, I think you already know my views on this, but I'll repeat them given = that you initiated the wider discussion. First off, when I suggested = that we might make use of the notion of a special state, the term that I = used was "singular", not "singleton". As others pointed out, the two = terms are not interchangeable.=20 At first I was considering adding a hook to any_view providers a chance = to install a "wrong type" handler. But I soon began to sort my ideas = out, and I set this aside when Sean said he would consider adding type = constraints to the model. I never intended for protocol relating to = singular to live in any_view. I sketched my reasons after I noticed that = you had added such code to any_view, (before asking you to remove it). I = explained my resistance in a bit more detail, offering a rationale = similar to the one Sean gave above, after noticing that you added it = back to any_view again (before asking you to remove it a second time). = Can you say more about why you keep aiming to get singular protocol into = any_view, especially in a world where, say, types could be checked in = the model and the concrete view can choose as specific or as general a = view_model_type as they wish? - Mat P.S. Does anyone know how we could get a review daemon installed on = opensource.adobe.com? Subscriptions in user specs don't seem to work for = me at the moment. ### Foster wrote, in two messages:=20 > I think this makes a ton of sense. In all the cases I had=20 > considered, there was no way the widget would be able to=20 > display something reasonable with the invalid data. Your=20 > example of a graph-like widget made a lot of sense, as well=20 > as the notion of extracting as much worthwhile information as=20 > possible and putting it up for display. So, in light of that,=20 > I'd propose add a view concept API to something like: >=20 > void singleton(const model_type& value); >=20 > We might also want to have a nullary singleton function for=20 > the case when the widget is asked to display something it=20 > can't decipher. For example, an edit text field being asked=20 > to display an icon: >=20 > void singleton(); >=20 > Thoughts? >=20 > -----Original Message----- > From: ado...@li...=20 > [mailto:ado...@li...] On=20 > Behalf Of Foster T. Brereton > Sent: Tuesday, October 17, 2006 4:32 PM > To: adobe-source developers; ASL Users > Subject: [Adobe-source-devel] View concept singleton state >=20 > Hey all, >=20 > I wanted to email the group regarding something I'm=20 > implementing for the preset widget, because I think it can be=20 > lifted into the View Concept as a whole. >=20 > A while back Mat and I were talking about the following=20 > problem: what is the proper behavior of a view when it is=20 > asked to display a value it cannot display? As an example,=20 > let us say I have an 'analog clock' =20 > display and it is asked to show the time 25:75. What should=20 > the clock do? To solve this, (thus far) we came up with the=20 > idea that every view should have a singleton state. The=20 > singleton state for a view is entirely=20 > implementation-specific; for instance in the clock example,=20 > the view could set itself to noon and make the clock have a=20 > red background -- something obvious to the user that says "I=20 > no longer accurately reflect the value in the model I have=20 > been asked to display". The instant the model communicates to=20 > the view a new value that it can display, the view should=20 > display the new value normally. >=20 > The notion of a 'singleton value' does not exist, so the=20 > ability for the user to put a widget into the singleton state=20 > is prohibited. What would trigger the singleton value for a=20 > view usually takes the form of controller 'A' setting the=20 > value of a cell that view 'B' (also bound to the cell) cannot=20 > display. The value would be valid for A as a controller but=20 > not B as a view, so B reverts to the singleton state. >=20 > Therefore, in the case when the view is also a controller=20 > (aka a widget), there is an additional requirement to be=20 > placed on the widget while in the singleton state. In=20 > addition to the above view requirement, the widget must also=20 > allow for valid user manipulation of the controller while=20 > displaying the singleton state. In the clock example above,=20 > (should the clock view be part of a clock widget), the=20 > singleton state should allow for the user to set another=20 > (valid) time (for example, by dragging the hands of the clock=20 > with the mouse). >=20 > As a more concrete example, I am reworking the ASL preset=20 > widget so it models the View concept -- it is bound to a=20 > 'result' cell of the property model. When the result cell is=20 > updated, the preset widget compares its list of available=20 > presets against the result cell -- when a preset is found=20 > whose contents are a subset of the result cell, that preset=20 > is selected. The singleton state, then, occurs when the=20 > result cell is in a state for which no preset exists. The=20 > display behavior I am implementing is to append a menu item=20 > named "Custom" to the preset category list. This will still=20 > let the user select a new preset category from the preset=20 > category list, but at the same time clearly tells the user=20 > "the dialog as it stands matches no presets." >=20 > Thoughts? >=20 > Blessings, > Foster >=20 >=20 > -- > Foster T. Brereton <=E1=BC=B0=CF=87=CE=B8=CF=8D=CF=82>< = Romans =20 > 3:21-26 > A d o b e S o f t w a r e T e c h n o l o g y L a b > "What 99 percent of programmers need to know is not how to=20 > build components but how to use them." -- Alexander Stepanov=20 > "Now we have very simple code and the meaning is perfectly clear. =20 > Drink the Kool-Aid" -- Sean Parent >=20 >=20 > -------------------------------------------------------------- > ----------- > Using Tomcat but need to do more? Need to support web=20 > services, security? > Get stuff done quickly with pre-integrated technology to make=20 > your job easier Download IBM WebSphere Application Server=20 > v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057& > dat=3D121642 > _______________________________________________ > Adobe-source-devel mailing list > Ado...@li... > https://lists.sourceforge.net/lists/listinfo/adobe-source-devel >=20 |