URI DEV: Difference between revisions

From AniDB
Jump to navigation Jump to search
mNo edit summary
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{TOCright}}
==General==
==General==
The current URI system is a mess made up of different sets of parameters for the same purpose depending on who and when wrote somehting. the idea is to first to remove unneccessary stuff from it, second standarize parameter and third make ir richer in feature
The current URI system is a mess made up of different sets of parameters for the same purpose depending on who and when wrote something. The idea is to first to remove unnecessary stuff from it, second standardize parameter and third make it richer in feature


==Guidelines==
==Guidelines==
Line 9: Line 11:
* help visualize the site structure
* help visualize the site structure
* are short
* are short
* use lowercase
* use lower case
* don't use unexpected punctuation
* don't use unexpected punctuation
* lack query parameters
* lack query parameters
* allow public linking
* allow public linking
* are stateless
* are stateless
* dont expose technology
* don't expose technology
(blatantly stolen from: http://www.eakes.org/archives/2005/01/flickr_uris.html )


what not to do:
what not to do:
* use plurar for parameter when you shouldn't (i.e. animes/5 instead of anime/5)
* use plural for parameter when you shouldn't (i.e. animes/5 instead of anime/5)
* use "=1/=on". if the parameter is in the url it IS on. if not it's not which leads to
* use "=1/=on". If the parameter is in the URL it ''is'' on. If not it's not, which leads to...
* don't add unneccessary parameter
* don't add unnecessary parameters
 


==Vision==
==Vision==
* 1(!) standarized Parser through which the data passes first
* 1(!) standardized parser through which the data passes first
* unnessary scary things like /perl-bin/animedb.pl
* unnecessary scary things like /perl-bin/animedb.pl
* structured URI
* structured URI
* standarized parameter
* standardized parameter
* let http://anidb.net/gonzo or http://anidb.net/chobits use the Full Text Search and return useful stuff instead of failing ([http://tracker.anidb.net/view.php?id=798|Tracker]])
* let http://anidb.net/gonzo or http://anidb.net/chobits use the Full Text Search and return useful stuff instead of failing ([http://tracker.anidb.net/view.php?id=798|Tracker]])
* use dictionaries where possible and avoid unneccessary &
* use dictionaries where possible and avoid unnecessary &
* use POST instead of GET when possible. i.e. for adds, deletes, edits, votes. Basically anything that actually modifies data. For anything else (read only) gets should be used.
* ...
* ...


===shortterm simple Changes===
===shortterm simple Changes===
* get rid of "/perl-bin/animedb.pl"
* get rid of "/perl-bin/animedb.pl"
yes we use perl. no we don't need to throw our "perl penis into the face of everoyne else" (as rar calls it)
yes we use Perl. no we don't need to throw our "Perl penis into the face of everyone else" (as rar calls it)
* ...
* ...


===Design idea 1===
===Design idea 1===
* http://anidb.net/<page>(/<id|name>/<action>/)/<paratemer>
* <nowiki>http://anidb.net/<page>(/<id|name>/<action>/)/<paratemer></nowiki>
 
<id|name> and <action> are only needed for specific entries hence why those pages should not use plural for the pagename i.e. anime instead of animes
the plural version should be reserved for lists. so instead of animelist we just use animes. that simpler and more logic. aside shorter.
 
actions could be:
:* /show/ (could be used by default, but we should really just leave that out. unnecessary clutter. accepting it anyway would be fine though. accepting is fine. forcing is bad.)
:* /edit/
:* /history/
:* /vote/
:* /delete/
...
 
parameter could be something like
parameter could be something like
:* /h&mylist&noalias&wishlist&orderby.name.desc
:* /h&mylist&noalias&wishlist&orderby.name.desc


in full example this:
====Examples====
this:
:*http://anidb.net/perl-bin/animedb.pl?h=1&mylist=1&noalias=1&orderby=name&orderdir=0&show=animelist&wishlist=1
:*http://anidb.net/perl-bin/animedb.pl?h=1&mylist=1&noalias=1&orderby=name&orderdir=0&show=animelist&wishlist=1
could look like this:
could look like this:
Line 55: Line 71:
becomes:
becomes:
:*http://anidb.net/anime/1/edit
:*http://anidb.net/anime/1/edit
==Reference Material==
*http://miscoranda.com/159
*http://www.w3.org/Provider/Style/URI.html
*http://www.alistapart.com/stories/urls/
*http://www.ibm.com/developerworks/library/us-cranky8.html?dwzone=usability
[[Category:Development]]

Latest revision as of 20:08, 15 May 2009

General

The current URI system is a mess made up of different sets of parameters for the same purpose depending on who and when wrote something. The idea is to first to remove unnecessary stuff from it, second standardize parameter and third make it richer in feature

Guidelines

URI's:

  • don't change
  • are human guessable
  • are logical (no need to mirror a filesystem)
  • help visualize the site structure
  • are short
  • use lower case
  • don't use unexpected punctuation
  • lack query parameters
  • allow public linking
  • are stateless
  • don't expose technology

(blatantly stolen from: http://www.eakes.org/archives/2005/01/flickr_uris.html )

what not to do:

  • use plural for parameter when you shouldn't (i.e. animes/5 instead of anime/5)
  • use "=1/=on". If the parameter is in the URL it is on. If not it's not, which leads to...
  • don't add unnecessary parameters

Vision

  • 1(!) standardized parser through which the data passes first
  • unnecessary scary things like /perl-bin/animedb.pl
  • structured URI
  • standardized parameter
  • let http://anidb.net/gonzo or http://anidb.net/chobits use the Full Text Search and return useful stuff instead of failing ([1]])
  • use dictionaries where possible and avoid unnecessary &
  • use POST instead of GET when possible. i.e. for adds, deletes, edits, votes. Basically anything that actually modifies data. For anything else (read only) gets should be used.
  • ...

shortterm simple Changes

  • get rid of "/perl-bin/animedb.pl"

yes we use Perl. no we don't need to throw our "Perl penis into the face of everyone else" (as rar calls it)

  • ...

Design idea 1

  • http://anidb.net/<page>(/<id|name>/<action>/)/<paratemer>

<id|name> and <action> are only needed for specific entries hence why those pages should not use plural for the pagename i.e. anime instead of animes the plural version should be reserved for lists. so instead of animelist we just use animes. that simpler and more logic. aside shorter.

actions could be:

  • /show/ (could be used by default, but we should really just leave that out. unnecessary clutter. accepting it anyway would be fine though. accepting is fine. forcing is bad.)
  • /edit/
  • /history/
  • /vote/
  • /delete/

...

parameter could be something like

  • /h&mylist&noalias&wishlist&orderby.name.desc

Examples

this:

could look like this:

this:

like this:

and this:

becomes:

Reference Material