July 29, 2013
1:49 p.m.
Am 29.07.2013 um 15:46 schrieb "Esteban A. Maringolo" <emaringolo@gmail.com>:
Hi all,
Is it a good practice to use the OID value (anInteger) as an "external" identifier of your domain object?
Let's suppose I have a collection of "People", as I save them in the collection, it will automatically create OIDs for them.
But let's suppose I want to map that person to a RESTful URI, would it be "legal" to use its OID as part of the URI?
E.g. mydomain.com/people/123456790 where 123456790 is the OID value.
I like OID/UUIDs, and I don't want to duplicate that logic in my app.
I think for your purpose OID will be fine but I'm not sure. I use UUIDs. You can instruct mongo to use a UUID instead of an OID. Works flawlessly. Norbert