Re: didUpdate?
Re: didUpdate?
- Subject: Re: didUpdate?
- From: email@hidden
- Date: Mon, 30 Jul 2012 09:18:06 -0400
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@hidden>
To: Theodore Petrosky <email@hidden>
Cc: "email@hidden" <email@hidden>
Subject: Re: didUpdate?
Message-ID: <email@hidden>
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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden