The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Ambiguous REST addresses

Hello,

I am in the process of planning a REST interface and would welcome some suggestions on the URL hierarchy when resources can be identified in multiple ways.

Standard examples given for REST addresses would be:

  example.com/product/1234
  example.com/customer/1234

These example are unambiguous because we're accessing the item using its primary key.

How should I structure my URL if I want to locate a piece of information at some kind of intersection?

For example: objects at the cordinates (x, y)

  example.com/object/?x=3&y=5
  example.com/object/x/3/y/6
  example.com/object/x=3/y=6
  example.com/object/(3,5)

Also, not wanting to make a mockery of the 'u' in url, are these the same resource?

  example.com/object/x=3/y=6
  example.com/object/y=6/x=3

Any thoughts?
Tim Hastings Send private email
Thursday, September 14, 2006
 
 
> example.com/object/x=3/y=6

How about: example.com/find/x/3/y/6
son of parnas
Thursday, September 14, 2006
 
 
I like: "example.com/object(6,3)"

Looks like a function call.
Almost H. Anonymous Send private email
Friday, September 15, 2006
 
 
How about structuring it using WSDL?

Google uses it, but it's not good enough for you?
Sorry
Friday, September 15, 2006
 
 
example.com/object/3,6

That would be a concise and REST-ful way to represent it.

I don't think there are any hard rules here, just stay consistent with the idea that REST URL's describe resources, not actions.
NPR
Sunday, September 17, 2006
 
 
> REST URL's describe resources, not actions.

Many times actions are the real resources.
son of parnas
Sunday, September 17, 2006
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz