Re: EOGenerator and takeStoredValueForKey dumb question
Re: EOGenerator and takeStoredValueForKey dumb question
- Subject: Re: EOGenerator and takeStoredValueForKey dumb question
- From: Chuck Hill <email@hidden>
- Date: Tue, 22 Aug 2006 13:04:24 -0700
On Aug 22, 2006, at 11:00 AM, Miguel Arroz wrote:
Hi!
I'm using EOGenerator to generate my classes from the model.
Today, I found out that EOGenerator generates accessors using the
trusted key/value operations, like:
public String address() {
return (String)storedValueForKey("address");
}
public void setAddress(String aValue) {
takeStoredValueForKey(aValue, "address");
}
This causes that, when I use setAddress(address), the value does
not go trough the validateAddress method.
It is not supposed to. validateAddress is intended to be called
_before_ setAddress is called. Right, wrong, or weird, that is how
EOF is intended to work. Objects are permitted to be invalid and
validity is checked during saveChanges().
When using form values and WOComponents, the values are actually set
using validateTakeValueForKey which calls validate... before calling
set....
This looks strange, but I suppose there are any reasons why
EOGenerator authors prefered the trusted operators instead of the
normal "takeValueForKey" ones. Anyone knows why? Is there a problem
if I change the templates to use the normal operators?
Any changes that you make to that method are very likely to cause
problems with EOF or stack overflow errors (if you are lucky).
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
_______________________________________________
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