• Post Reply Bookmark Topic Watch Topic
  • New Topic

REST design question  RSS feed

 
Pho Tek
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I need some help in designing the URIs of my REST application.
I am writing a backend that will host a midlet. This midlet will
evolve over the months/years and I want the midlet itself to perform
a version check against the server.

My current URIs look like this:

I'm new to REST, so I'm not sure if this design is ok.
Basically requests to even item numbers return a version string.
While requests to odd item numbers will return the midlet JAD file
with Content-type text/vnd.sun.j2me.app-descriptor.

Item #1 is like a symbolic link to item #5.
Similarly item #2 returns the same result as #6.
Are these "symbolic linking" URIs compliant with the REST philosophy ?

Thanks

Pho
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You seem to be overlooking the hypermedia aspect of REST.

/app/latest

can still return the JAD of the latest version. However the JAD already contains the version number - so why do you need /app/latest/version?

more importantly

/app

should return a representation of the "directory of available versions". That representation could be in plain text CSV, XML, XHTML, or whatever is appropriate. Each row would at least contain a link to the JAD and could also contain version number and version date: e.g.

If the version number is that important you could have

/app/latest

return

which gives you a link and the version

This would seem more flexible to me.
 
Pho Tek
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peer,

Thanks for your reply. Your answer is very insightful.


However the JAD already contains the version number - so why do you need /app/latest/version?

The reason why (I think) I need distinct URIs:

is because the consumers of these two URIs are different.
For #1, the consumers will be the phone browsers inside phones.
For #2, the midlet application is the consumer.

Thanks

Pho
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!