[microformats-discuss] STRUM, REST, and DETH
maetl at mcs.vuw.ac.nz
Tue Oct 11 18:26:12 PDT 2005
> That is, it is a stylized convention for how to parse useful
> information out of a human-readable structure. But not just any
> information. The goal, in fact, is to extract REST-compliant web
> services out of XHTML forms. Not only would this allow you to use a
> generic web browser to invoke/test these web services, but it also
> ensures that the API is (at least minimally, and possibly
> significantly) self-documenting.
> The idea is that a DETH web service is described by a URI, e.g.,
> "http//somesite.com/users". You can either:
> a) do a GET (with no body) against that URI, or
> b) do a POST containing a 'dl' dictionary or an url-encoding key-
> value list.
My perspective is that this kind of thing is already well supported by
the structure of traditional HTML forms. To put it another way, an
HTML form *is* a REST compliant service, and various automated clients
exist (mostly testing tools) that can navigate HTML, fill out form
fields, and submit the data.
> There's a few questions about the design pattern I'm unsure about.
> Is the Microformat Zen here to conform as closely as possible to
> existing (HTML 4) idioms, even if sometimes ambiguous, or make
> 'class=deth' a strong contract a la XOXO? For example:
> a) Should we require labels for *all* inputs (except submit/reset)?
> This seems much more descriptive and human readable, but isn't
> strictly necessary.
It's good practice - the principle of human readability (and standard
visual design) dictates that each form field should be clearly
> b) Should we nest inputs inside labels? That keeps things nicely
> grouped, but prevents us from using tables for layout. Is that an
> important degree of freedom to preserve?
AFAIK, this is used by some designers, but doesn't quite sit right -
as the content of the label should be a readable description for the
It's also common to use definition lists for marking up forms (though
arguably beyond the semantics of what a dl is supposed to mean)...
> To be sure, this is not a "full" REST solution. It wouldn't support
> PUT or DELETE, or any input more complicated than a dictionary. But
> that's the point -- the goal is to build the simplest possible system
> that does *any* useful work, so we can find out where the real
> pressure points are *in practice*.
I'm still not quite sure what is gained from mixing these two aspects
together (accepting POST data in both XHTML format and url-encoded
I just wonder that the structure of inputs nested inside a form tag
(with name attr being the key, and value attr being the value) already
represents a dictionary, and that this is the default web (and REST?)
Perhaps an advantage of using xoxo is that you can create the kinds of
web services that you're discussing without using form elements at
all, and keeping the data format essentially human readable.
I guess I'm just a little confused about what you're suggesting and
what it leads to - whether you are talking about a generic description
layer for XHTML POST services (a way of using HTML dictionaries to
define an allowable set of key/value pairs that can be accepted by a
specific URI) - or whether you are looking to rebuild/replace the
structure of form inputs with dictionary lists. Maybe both?
More information about the microformats-discuss