Take the 2-minute tour ×
User Experience Stack Exchange is a question and answer site for user experience researchers and experts. It's 100% free, no registration required.

I have a website where factories are stored in different categories, but now i was wondering how to call the factories in my urls.

I have an url for showing factories in a category:

http://mydomain.com/factories

I also have a page where all my factories from the database are displayed i don't know how to call that url. the url can not be the same so i need something that works for everybody.

i tried something like:

http://mydomain.com/allfactories

but i think it looks stupid.

Could someone help me out with this?

share|improve this question
add comment

3 Answers 3

up vote 12 down vote accepted

A quite common pattern for showing all of something is to extend the category with a filter, which in your case would be something like:

http://mydomain.com/factories/all

That way you can use the filter in your URL to select factories in let's say Europe:

http://mydomain.com/factories/europe

And moving down the list to a single factory, such as:

http://mydomain.com/factories/my-industry

You'll have a flat structure on your filter and need only to implement your taxonomy on each factory correct.

share|improve this answer
1  
awesome. this looks fine for me :D thanks. –  Kees Sonnema Apr 17 '13 at 7:44
add comment

Even though this presentation is about REST, it talks a lot about URLs, (from 16min to 25min approx) and might interest you.

Main points that gets out of the presentation is that the URL should represent a ressource, and filters of these ressources should go in the query string. The query string is meant to be specific to the query, and filters are a direct fit for this category.

In your case, I would go with something like

http://mydomain.com/factories -- to retrieve all factories
http://mydomain.com/factories/{id} -- to retrieve a specific one

http://mydomain.com/factories?category={cat} -- to filter a category.

The reasoning behind that is that if tomorrow you want to add more filters, what will you do? Just add more slashes?

And get to something along :

http://mydomain.com/factories/myCategory/united-states/blep/bloop -- ???
http://mydomain.com/factories/myCategory/blep/bloop -- Oh wait now, is blep a country? This is not clear

This is pushed to the extreme, but it shows something that can become very problematic, because some parameters will become obligatory as you add more possibilities.
The parameters in the URL become ambiguous; we can not know which parameter is which if they are not all there and in order. But if I need to put all parameters, then the default one get in the URL and everything gets cluttered.

share|improve this answer
    
Thanks for the answer. i will look at that for sure! –  Kees Sonnema Apr 17 '13 at 14:44
1  
@Kees It might seem long (1hour), but it's a very good presentation and it is very well done. It's made by David Zülke a guy who works for Symfony Framework –  Hugo Dozois Apr 17 '13 at 14:45
add comment

Since there are multiple categories, I would suggest using http://mydomain.com/factories/category-X, and http://mydomain.com/factories/all

share|improve this answer
    
yeah i think /factories/all looks nice. but i want to keep the urls as clean and short as possible. so i think this is the best way. –  Kees Sonnema Apr 17 '13 at 7:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.