Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK)
Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK)
- Subject: Re: ERXRestFetchSpecification defaultSortOrderings ordered by id (PK)
- From: David Avendasora <email@hidden>
- Date: Sat, 17 Mar 2012 03:39:41 +0800
On Mar 16, 2012, at 5:04 AM, Rich wrote:
> My only quandary around all this is if the PK is 'so' precious' to EOF and should never be 'used'
Hold on, it's not that it is 'precious to EOF' it is that it is precious to the database. You can easily abuse PKs with any language, even just plain SQL by simply assigning a meaning other than "this uniquely identifies this record in this table in this schema of this database". I may have been a bit overzealous last night in my emails. Chuck's points are valid. If what you want is to use the PK in your app for what it is, then you'll be fine - as long as that's all you do with it.
To me, using the PK in your Java code is a gateway drug*. It can be the easy way out, but it starts you down the slippery slope to far worse database debauchery. (don't get me started!)
(*like many drugs, they do have some medicinal value and can be appropriately. The #1 example is Johan's example of using it as a sort parameter for batching display groups to keep the same record from appearing in multiple batches due to the non-deterministic nature of SQL queries, but then you are using it EXACTLY as it is intended to be used, so really, that's not an exception to my rule, other than it means referring to it in your code)
> (Which I do see David A point)
Careful with that. You could end up doing D2JC if you start seeing things my way… and even _I_ wouldn't do that anymore … okay, okay, not on this project. Okay! FINE! Not today. Maybe tomorrow though...
> , why is it returned by default in the ERRest data representation? - If it's not meant to be used for anything, surely it would be better not to return it at all hence forcing the developer to create an appropriate field if required.
I refuse to publicly question Mike's decision to use the PK as an identifier in ERRest. Mike moves in strange and mysterious ways and it is not my place to question Him.
Kieran, on the other hand, I _love_ to question him.
Usually over a pint o' Guinness or two … dozen.
Happy St. Patricks day!
Dave
—————————————————————————————
WebObjects - so easy that even Dave Avendasora can do it!™
—————————————————————————————
David Avendasora
Senior Software Abuser
Kaiten, Inc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden