JanxSpirit / mycotrack_mongo

A Scala Lift application for tracking mycological cultures.
4 stars 2 forks source link

Figure out a method of auto generating ID's #8

Closed ctcarrier closed 13 years ago

ctcarrier commented 13 years ago

When a user creates a new project we should have the option of auto generating a random Id for them. We should probably also have this option for cultures. We want them to be short enough that it's easy to use as a label but of course it needs to be unique for that user. On the create project/culture screen we should have a text field with a check box 'Auto generate ID'. If the checkbox is checked the text field is greyed out and the system will generate their ID. Or they can uncheck it and use their own ID's. In either case I would think we want to validate uniqueness.

JanxSpirit commented 13 years ago

Should this be the unique id for the project/id (ie the _id in Mongo) or just a handle that is not unique across users?

I'm thinking of things like using it in resource uris.

We can do shortish ones either way, but of course they get longer more quickly if they're unique across the application. Still could fit a crapload of them in under 5 or 6 characters.

ctcarrier commented 13 years ago

The shorter the ID the better. If we're talking a REST like API then wouldn't the address be something like /user/userId/project/projectId, in which case they could still be unique addresses even if we don't guarantee the projectId is unique across the app? I dunno putting the userId in the URL doesn't seem very common. I guess if the ID's were unique across the app we could have a URL that, if the owner was logged in would go to a management page, or if not the owner go to a public type page. Like 'project/id'.