Re: [OT] Not everything goes well in Ruby land :-)
Andrus Adamchik <[email protected]> Mon, 7 Jan 2008 23:57:20 +0200
| Newsgroups | gmane.comp.web.webobjects.general |
|---|---|
| Message-ID | <[email protected]> |
There's an endless discussion about that on Cayenne user list, and at the end everybody still uses PK's in URL's and DataObjectUtils.objectForPK(..) and DataObjectUtils.intPKForObject(..) are the two most popular methods in the framework :-) Good or bad, people prefer simplicity in most situations. A simple rule of thumb - if you don't care that a rogue user may hack a URL by trying various random or sequential ids, then use your PK and save time on building an extra abstraction. This may be true even if a page requires security... Andrus On Jan 7, 2008, at 11:41 PM, Miguel Arroz wrote: > Hi! > >> That said, what I think WebObjects could steal from Rails is the >> whole concept of less configuration for the default behavior. >> There's all this stuff that a production-quality WO program has to >> implement that should really come pre-done. It's not a lot of code >> to pull the primary key out of a URL, fetch the relevant object, >> and pass it to a page component for display, but everyone seems to >> be constantly reinventing that wheel. > > There's a lot of discussion about if it is dangerous, or not, to > expose the PKs. I prefer to avoid that when possible, but to be > honest, sometimes I end up doing stuff that is almost the same as > exposing the PK (exposing an UNIQUE field that is there exactly to > be exposed, for example). > > What do you think? What are the goods and the bads of exposing PKs > in URLs? > > Yours > > Miguel Arroz > > Miguel Arroz > http://www.terminalapp.net > http://www.ipragma.com