inamidst.com · patterns

Choice Not Echo

Choice-not-Echo is the principle, from the XML Accessibility Guidelines (XAG), that when you have a cascade of multiple modalities, the user should be able to choose between them freely in the user agent rather than being forced to consume only the author's first preference. This is slightly different from how the guideline ended up in XAG ("define flexible associations, where a given kind of relationship can link to or from objects of varying types without constraint"), so it was lost until now.

In other words, if an author specifies that a PNG image is her first preference, a JPG is her second preference, and then a text alternative is her third preference, a user browsing that in Firefox should be able to look at both the JPG and the text alternative with ease rather than being forced to view only the PNG.

So what this means to language designers is that, for example, adjacent children are bettern than nested choices because of the connotations of that. An example of the former is the <switch> element in SMIL; and of the latter, the <object> element in HTML. "Switch is better than Object" is another informal way of putting this design pattern for the initiated.

Good:

<switch>
<media href="something.png" type="image/png" />
<media href="something.jpg" type="image/jpg" />
<media type="text/plain">Something</media>
</switch>

Bad:

<object href="something.png" type="image/png>
 <object href="something.jpg" type="image/jpg">
  <object type="text/plain">Something</object>
 </object>
</object>

Sean B. Palmer, inamidst.com