Re: Is an XForm an application for, or a representation of an instance data?

On Jul 22, 2011, at 10:26 AM, Philip Fennell wrote:

> This is good philosophical stuff but with a practical edge to it:
>  
> With regard to XForms and RESTful Web Services, a favourite hobby-horse of mine, I was answering a question on the xsltforms-support mailing list about setting the Accept header for submissions and commented upon a solution that used the same URI to retrieve either the XML representation of the resource or an XForm that referenced the resource. The Accept header was used, via content negotiation, to indicate which representation was required. The implication is that if you use the same URI then the XForm must be regarded as another representation of the resource pointed to by the URI.
>  
> My questions are:
>  
> 1) If you embed an instance data document inside an XForm that provides a view of the document’s content, can the resulting XForms document be thought of as a representation of the instance data?

There is a sense in which this question appears to be one of human psychology.
Is it possible for someone to think of a form to edit X as being a representation of
X?  That's an empirical question to which the answer is pretty clearly 'yes'.

Is it a reasonable way of thinking?  Is it, in particular, consistent with the way
Web architecture defines 'resource'?

As far as I can tell, Web architecture does not define 'resource' at all, and
all the discussions of Web architecture I've seen clearly prefer to risk 
obscurity and confusion rather than risk unintentionally limiting what can be
thought of as a resource.

So as far as I can see, speaking only for myself, yes, it's perfectly consistent
with Web architecture, both in the sense of not contradicting it (there not being
much to contradict) and in the sense of appearing to be a perfectly legitimate
exercise of the resource owner's responsibility to decide what a resource is
and what counts as a representation of it. 

I think it's also consistent with Web architecture to decide to give X and a form
to edit X different URIs -- the resource owner appears to be the one who has 
the right and responsibility to decide.

>  2) If the answer to the (1) is 'yes', then does that still hold true when the instance document is no longer embedded, in-line, but is included by URI reference instead?

I think so.  Or perhaps I should say I think it should:  making a question of
resource identity depend on whether certain content is inline or present by
reference seems to place more weight on network location than is a good
idea.

>  
> 3) If you’re happy that the answers to (1) and (2) are 'yes' then, given that both the XML representation of the resource and the XForm representation of the resource are nominally application/xml but the later could be application/xhtml+xml, how would you use content negotiation to differentiate between the two requests? You have to take into account the fact that different XForms implementations require different response content-types in order that the form will be processed correctly and also you cannot rule-out that a plain application/xhtml+xml (XHTML) representation may also be required.

Really good question, to which I for one don't have a good answer.  Some
very smart people I know have told me content negotiation is the right answer
for a lot of things, so my instinct is to say it sounds promising.  But (a) they
have also complained bitterly that conneg is not well implemented or
understood, so I have never been sure it was possible to make it work without
more effort than normal humans can expect to expend, and (b) there is
always the possibility that conneg appears to be the right answer only because
one cannot currently use it very well, and that concrete experience using it 
will reveal that it works well as an answer for some things and not for others.


>   
> The ability to request a representation of a resource that allows the resource to be edited is an interesting one and I’m not sure it has been covered in any great detail if at all.

Agreed on both counts.

> Is the editing application a resource in its own right or a representation of the resource.

That's a Web Architecture koan if I've ever seen one.

> It’s all rather relative and seems to revolve around whether you see the user accessing the resource to edit it or they access an editing application (the XForm) that retrieves the resource.

I think I agree.

> I’d be interested in your opinions.
>  

For what it's worth, then, here they are.

best,

Michael Sperberg-McQueen


-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com 
* http://cmsmcq.com/mib                 
* http://balisage.net
****************************************************************

Received on Saturday, 23 July 2011 18:04:30 UTC