Re: [OT] Not everything goes well in Ruby land :-)
Chuck Hill <[email protected]> Mon, 7 Jan 2008 20:24:51 -0800
| Newsgroups | gmane.comp.web.webobjects.general |
|---|---|
| Message-ID | <[email protected]> |
On Jan 7, 2008, at 3:13 PM, Mike Schrag wrote: >> If you expose any "developer private" information, users are going >> to start to rely on it. Consider it UI. Preventing you from making >> changes. I.e. Users could start bookmarking URLs with primary keys >> in them. > But that's perfectly valid, right? RESTful folks would say that > your URL's ARE API ... Excluding component action URLs, I would agree that they are API. And if I use a PK in a URL and that PK becomes no longer valid, the URL _should_ stop working. If that is not the correct behavior, then the PK is the wrong thing to use in the URL. > Especially if you start exposing ActiveResource-style RESTful XML > services, those are going to have to have SOME sort of ID's in > them. Like Chuck said, you could use some other candidate key, but > if you have a sufficient non-OID candidate key that is going to be > basically invariant and act in this capacity in your API, why not > just make that your PK in WO in the first place? I lean more towards always making a meaningless PK. Candidate keys have a bad habit of needing changes over the years. But if I had a candidate key, I would prefer to that in my URL. Chuck -- Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects