Hi Theodore,

I agree with George, I wouldn't do the Session way.

Worman set you on the right track. Ok, it didn't fully give you the 
solution but it pointed you where to look.

The EOEditingContext knows all. It knows what the current values are (just 
invoke methods on the EO itself) it also knows what the last saved values 
are (just look at the "snapshot" cache using the EC and the EO).

You see? So that method Worman pointed you to just gave you the new 
changed values. Ok, but dig under the covers of that method. It's open 
source right? (unlike Apple's code). Learn how to navigate the snapshot 
cache. That method must be able to find the old values right? Otherwise 
how can it pump out the new values of only the modified attributes?

Think of the EC as a "bolus of work." It does everything you were trying 
to reinvent with your Session plus more. Use the EC to its fullest. It 
knows past and present at the same time. Nothing else is needed. 
"willUpdate" is a reasonable place to put the logic you seek, keep it all 
in the model, and work cleanly with D2W.

Cheers,
-- Aaron

Date: Sun, 29 Jul 2012 07:49:33 -0700
From: George Domurot <[email protected]>
To: Theodore Petrosky <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: Re: didUpdate?
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

For me, I'd say you're going at this the wrong way within the Session..

Keep the session clean.

Check out Paul Yu's recommendation re: ERXGenericRecord and 
ERXEnterpriseObject.  And, write a controller to manage the object you're 
editing, do your work, and let it provide you with the appropriate 
feedback for your email.

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

This email sent to [email protected]

Reply via email to