On Fri, 2010-04-09 at 10:09 +0100, Mark McLoughlin wrote:
I'm starting to lean towards using URIs rather than GUIDs
If you look at e.g.
<vm href="http://{host}/vms/{guid}">
<id>{guid}</id>
<name>foo</name>
</vm>
then the URI serves as the true global identifier for the resource, the
name serves as a human-readable identifier and the guid just seems like
bloat
One of the reasons to include explicit URI's is so that we can later
change our mind about the URI structure of the server, without any ill
effects for the client. IOW, the URI is not stable enough to uniquely
identify the object for a long time.
The above brings up another nitpicky issue: it would be nice if we had a
simple way to use the same tag as the container of details for an
object, and as a reference for that object. There's also the slight
annoyance that it is generally easier to work with attribute values in a
DOM than with text nodes. So rather than the above, I'd suggest
<vm href="http://{host}/vms/{guid}" guid="{guid}"
name="foo">
... vm details ...
</vm>
That can be used for both the container of VM details, and for
references to a VM (e.g., if you want to indicate which VM is using an
image) In that case, you'd write
<vm href="http://{host}/vms/{guid}" guid="{guid}"
name="foo"/>
and the client should have enough information to do some basic
processing (display a link to the VM details, cross-reference the VM
with other data it might be holding) without having to get the entire VM
details.
And no, that's not how deltacloud does it right now, though I think it
should.
David