← Back to team overview

launchpad-dev team mailing list archive

Re: Redesigning lazr.restful support for AJAX

 

On 09-11-18 04:14 PM, Gavin Panella wrote:
On Wed, 18 Nov 2009 14:06:43 -0500
"Francis J. Lacoste" <francis.lacoste@xxxxxxxxxxxxx> wrote:
A fragment is a view.

The common use case is not 'Get me a bug comment', but 'Create a bug comment
and give me the result formatted through '@@bug-comment-details'.

Or 'Subscribe this user' and gave me back '@@+portlet-subscribers,
@@subscribers-count'.

If we expect each widget to know what page fragments to update it'll
become a tight bundle of spaghetti pretty quickly, especially if a
widget it used on more than one page.

Could the following pattern (probably has a name, but I don't know it)
help avoid it, such that a widget A doesn't have to care about the
presence or absence of widget B?

widget A is going to add a subscriber,
widget A says to client api machinery:
    "add subscriber, and get me +subscriber-fragment",
widget B see this, is interested in subscriber changes,
widget B says to client api machinery:
    "count me in, get +subscriber-xyz for me too",
client api machinery sends request to launchpad:
    "add subscriber, get +subscriber-fragment, +subscriber-xyz"
client api machinery dispatches results to widget A and widget B.

ISTR that Christian Heilmann spoke of something like this at the Epic?


Interesting idea.


I /think/ he meant, why not use the same ingress point to the
application as other web pages, rather than piping through the API?

Yes, that is what I meant :)

Maris

Attachment: signature.asc
Description: OpenPGP digital signature


References