On Sep 8, 2008, at 4:27 PM, Florijan Stamenkovic wrote:

On Sep 08, 2008, at 18:48, Chuck Hill wrote:

Primary keys.

Oh yeah. That makes sense too... Hm, do you know if EOF throws a validation exception when trying to modify a read only attribute?

Yes. If you make your FK attributes public you will get this exception when saving updates. It is kind of wrong in that case, but many people have seen this "Attempt to modify a read only attribute" error message.


IIRC there was talk against making primary keys class properties, one of the arguments being that one should never modify them. But, if they are read only, and EOF throws, then that would not have been possible, no?

Personally, I don't have any issues with public primary keys as long as they are used responsibly. The objection is usually either religious or out of fear of irresponsible use. EOF will NOT let you change them.


You can also mark them as such in the model to have EOF verify there have not been any changes.

I am guessing that (if EOF indeed does not accept modifications of RO attributes) the purpose of this is to preserve existing data, and in situations in which data is created outside of EOF?

I think you can create new objects with these attributes assigned a value. You just can't change it afterwards.


Chuck

On Sep 8, 2008, at 3:46 PM, Florijan Stamenkovic wrote:

Hi all,

I'm looking into EOAttribute.isReadOnly(). Docs point out that an attribute is read only when it is derived (makes sense), but mention no other circumstance. So, anyone knows any other situation in which an attribute is read only?

Thanks,
F
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net

This email sent to [EMAIL PROTECTED]


--
Chuck Hill             Senior Consultant / VP Development

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









--
Chuck Hill             Senior Consultant / VP Development

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






_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to