I think the use case approach is the best way to unpack this. As such it seems we have been discussing three use cases:

1 Display a node and its properties
2 Display a node, its properties, and its children
3 Display a node its properties, and the full structure underneath it

If those are the use cases then I think the first one is the most basic case and should be the default, the other two should require some sort of addition to the URI. On the other hand, I guess, the discussion boils down to how we perceive the json request. Are we asking to serialize an object graph? If so then we should dump the whole thing. I am not sure, however, if I am comfortable with that given the potential consequences of dumping tons of data.

Going back the the filesystem analogy given this structure:

/
/foo
/foo/child1
/bar
/bar/child2

When I ask to list / I do not get a recursive listing unless I explicitly ask for it. Using the use cases above how would we expect request calls to work? What should the URIs look like? I think I agree with Toby that UC1 and UC2 should be collapsed so that a request for / foo would return foo's attributes plus list foo's child node names. A request for /foo.recurse would return /foo + all its children their properties their children, and so on... With those two types of request one could fulfill the browsing and the dump models Toby described. I also agree that these should be done with selectors and not query params as it makes caching much easier.

-paddy



On Jan 9, 2008, at 1:01 PM, Tobias Bocanegra wrote:

Why not:

   /stuff.json?depth=1

It's not like we need to use the URI mapping for everything.
because this breaks caching.

however, i think there are actually 2 use cases. the first is that you
need the deep serialization of a tree, e.g. a page, or an exploded
xml, or a dialog node structure description.... in this case you
always want a depth=infinity. the other one is the 'browsing' use case
where you only need the node and it's properties (and the names of the
childnodes!). so this is a special case anyways. this would be like
depth=0.5 :-)

so is there really a use case for depth=0 (i.e. node+properties)  ?
or is depth=0 just the node name, depth=1 the node name and it's
properties and it's childnode names? etc. ?

regards, toby
--
-----------------------------------------< [EMAIL PROTECTED] >--- Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---


Reply via email to