[Grok-dev] Re: applyChanges and add forms

Martijn Faassen faassen at startifact.com
Mon Apr 16 10:38:15 EDT 2007


Hey,

Philipp von Weitershausen wrote:
[snip]
> Right. Perhaps applyChanges should be
> 
> * amended to support the add form use cases
> 
> * and renamed to applyData or something similar
> 
> One could argue that we should have two methods, applyChanges (only 
> applies changes) and applyData (always applies all data, no checking), 
> but I'm inclined to say that this is a choice the novice Grok developer 
> won't necessarily care about. If we make applyChanges do the right thing 
> on even when the attributes aren't there, I think everybody would be 
> happy. But perhaps I'm missing something.

I think we're on the right track. I'd be in favor of renaming 
applyChanges to applyData, and making applyData on AddForm call some 
other code path which simply stuffs the attributes on the object no 
matter what. On EditForm it would be calling applyChanges.

I guess applyChanges still works due to subclassing, which is 
potentially confusing. Perhaps we should do some more trickery to make 
sure that the user cannot call this directly...

We need to verify what happens with the applyChanges return value right 
now. We also need to study what triggers the ObjectModified event.

Regards,

Martijn



More information about the Grok-dev mailing list