← Back to team overview

launchpad-dev team mailing list archive

Re: Redesigning lazr.restful support for AJAX

 

On November 17, 2009, Leonard Richardson wrote:
> This seems like a good design and simple enough to implement. We are
> already doing one adapter lookup for an HTML representation (at least
> for PATCH), so we would start doing multiple named adapter lookups.
> 
> From a theoretical standpoint my main objection is that
> "+subscriber-portlets" and "+subscribers-count" look like magic strings.
> Given that I understand how application/x-page-fragments works, how am I
> supposed to know that I can pass in those strings and no other strings?
> With a directory of available views, developers will know what's
> available and it'll be easy to make sure we have good test coverage.
> Without it, the HTML views will be another piece of magic that you can't
> understand without being an experienced Launchpad developer.

You are right about this, but I don't think it's a new problem nor a real one 
in practice.The use case here is really the AJAX client which is used by 
experienced developers. 

How do you know currently which views are available to render part of pages? 
Unless you hunt around or know the application, this is magic. So the 
situation in the AJAX environment isn't different than in the regular web 
development.

Sure, it doesn't help non-Launchpad client that would want to use the HTML 
views, but in practice this isn't the case.

> 
> It's easy to say "so we'll create a directory", but we'd need to figure
> out the best way to do it. The directory of views, or at least a link to
> it, would need to be present in the WADL, so that our human-readable
> documentation can include it.
> 
> Since it's clear you need this, I don't want to delay it by demanding a
> directory (especially since I don't have time to work on this), but I
> also don't want to end up with a two-tiered system where some parts of
> our web service are well-documented and understood by everyone, while
> other parts are only comprehensible to Launchpad developers.
> 

I think the idea of a views directory is a good one, and would be useful for 
web development as well as the web client. But I really don't see when we'll 
get resources behind that. So in practice, we'll have a two-tiered system, 
where the JSON representation is well documented and defined, and the AJAX 
system which is only useful for Launchpad development. And I think the 
intended audience for the two systems is different enough that it's not a 
problem. 

-- 
Francis J. Lacoste
francis.lacoste@xxxxxxxxxxxxx

Attachment: signature.asc
Description: This is a digitally signed message part.


References