Re: selectable model discussion

Tupshin Harper <[email protected]> Fri, 02 Jan 2004 17:14:38 -0800
Newsgroups gmane.comp.java.xwt.widgets
Message-ID <[email protected]>
Charles Goodwin wrote:

>On Fri, 2004-01-02 at 22:43, Tupshin Harper wrote:
>  
>
>>After re-reading your original message, I see your point about why that 
>>would be the case, but no, it strikes me as counter-intuitive. I bet 
>>many people when working with radio button groups, where only one item 
>>can be selected, would assume that group.selected would always return 
>>the currently selected item, which (almost coincidentally) most of the 
>>time, it would.
>>    
>>
>
>Other than when none is selected, it _always_ would for radio groups.
>  
>
Except it sets a very misleading expectation if you approach it that 
way, and try to extrapolate to slightly different group behaviours 
(check boxes or possibly radio groups where there is a way to reset to 
initial non-selected state).

>  
>
>>Certainly, a name change for group.selected along the lines of what 
>>david suggested would help. If so, I would prefer to have the current 
>>selection array be group.selected instead of group.selection. This seems 
>>to be a much more intuitive name for describing the current state of the 
>>widget.
>>    
>>
>
>Well, for me 'selected' implies singular and 'selection', plural.
>  
>
I have to strongly disagree with that. For me, neither has a strong 
singular vs plural connotation. 'selected' implies  "that which is 
currently selected", and 'selection' implies "that which is currently 
being (or has most recently been) operated on". Note that instead of 
plurality, for me, the strongest semantic differential between the two 
is *time* where the "ed" past tense suffix indicates the net result of 
all past actions and the "ion" referring to something that is more 
ongoing or recent. Certainly, in this context, both suffixes are 
ambiguous, hence the disagreement in connotation. But try as I might, I 
can't find a justification for the singular vs. plural interpretation. ;-)

>Perhaps it could be simplified to just two traps:
>
>$group.selection; // an array of selected members
>                  // - in the order they were selected
>$group.selected;  // the most recently selected member
>                  // - null if nothing is selected
>                  // - a shortcut to selection[selection.length]
>                  // - put to when a selection is made
>
>Ignoring the names (we'll obviously go with consensus), is that a little
>tidier than using 3 values?  I'm a little concerned at the awkwardness
>of accessing the most recently _unselected_ group member.
>
>I'm still not satisfied.  I'll think about it overnight and come back
>with a better option.
>
No, I'm not satifisfied either. I'll ponder it too.

-Tupshin