Re: Question about fetching
Re: Question about fetching
- Subject: Re: Question about fetching
- From: Christian Trotobas <email@hidden>
- Date: Tue, 21 Jul 2009 11:24:08 +0200
Hi Francesco
On 21 juil. 2009, at 09:56, Francesco Romano wrote:
Hi..
This is a simple (and maybe stupid) question.
No question is stupid on this list. Feel free to ask.
I'm doing an application (an e-commerce application.. maybe wo is
not the best choice, but I know java better than ruby..), and I've
some pages accessed with directaction.
WebObjects is a pretty good choice for ecommerce; take a look at the
Apple Store to be sure :)
Maybe I'm wrong, but I can pass values to a page only with the url,
so.. only strings.
In a page I select an EntityObject and I've to pass to the other page.
If I can't pass the whole object, I would like to pass the primary
key, so fetching should be faster..
But.. I can get the key, but I can't fetch an Object with it's PK.
Now i pass a name (a description string..).. but it's not unique, so
even with low probability, there can be collisions..
You should use a product ID which would be unique, like a part number
for example. It will be usefull too for accounting purpose, and not
only for the app internals. As a unique key, the PK could be used, but
depending on the nature of your business, you might want to avoid
exposing PK on the web: they should be considered both confidential
and subject to changes for technical reasons (though it is very
unlikely to occur).
In WebObjects, the EOF framework provides a unique identifier for EO:
it is the EOGlobalID. Basically, it is a compound from the EOEntity
name and the PK from the table (out of the box, it is how it works;
for specific reason out of the scope of your question, it happens that
it is not the PK; again, it is very unlikeky to occur for standard/
simple uses, so don't bother about this, it was just for information
purpose). Therefore, in your app, if you are looking for a unique
identifier for your EO objects, you have to use the EOGlobalID and not
the PK. Understanding how EOF handles the uniquing of objects is one
the keys for your successfull development with WebObjects.
Take a close look at:
http://developer.apple.com/documentation/Webobjects/Enterprise_Objects/Fetching/Fetching.html#//apple_ref/doc/uid/TP30001011-CH206-BADHCCEE
Hope that helps.
Christian Trotobas
What can I do?
Thanks
Francesco Romano
_______________________________________________
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
_______________________________________________
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