• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Listening for changes on an EO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Listening for changes on an EO


  • Subject: Re: Listening for changes on an EO
  • From: Chuck Hill <email@hidden>
  • Date: Thu, 9 Jul 2009 13:51:25 -0700


On Jul 9, 2009, at 1:28 PM, Lon Varscsak wrote:

Uh, another question. :)  Since I have a custom EO super-super class,
I decided to try to implement this in takeStoredValueForKey(..).

It works, although I was also trying to post the "old" value, and
asking for this current value at this point makes EOF not so
happy...but that's not strictly required for my needs.

However, it does post notifications even for fetched objects, what
would be the best way to only post changes after fetching?

This might be closer to what you want:

http://developer.apple.com/documentation/InternetWeb/Reference/WO542Reference/com/webobjects/eocontrol/EOObserverCenter.html

That would give you the "before" picture. You can set a flag there too (or in willChange()). If the flag is set, then in takeStoredValueForKey, you can send out the after notification and clear the flag. willChange() will not get called for fetched objects.



Chuck


On Thu, Jul 9, 2009 at 12:43 PM, Lon Varscsak<email@hidden> wrote:
Thanks for the tips!

-Lon

On Thu, Jul 9, 2009 at 12:34 PM, Chuck Hill<chill@global- village.net> wrote:

On Jul 9, 2009, at 12:26 PM, Lon Varscsak wrote:

Thanks.  I figured there was nothing built to do exactly what I
needed, but I figured I would ask.

Do you know if there is much overhead if I implemented this in my EO
superclass even if there were no observers?

EOF makes heavy use of notification. I would not expect there to be much
overhead. You will probably want to qualify the notification with the EC
(depending on what it is you are trying to do) to limit the number of
observers. And then keep the method receiving the notification fast. The
notifications are synchronous, so you don't want anything slow in this
method.



Chuck




-Lon

On Thu, Jul 9, 2009 at 11:50 AM, Simon McLean<email@hidden> wrote:

also, if you are using wonder, check out
hasKeyChangedFromCommittedSnapshot in ERXGenericRecord. maybe listen
for the notification mentioned by chuck, then use
hasKeyChangedFromCommittedSnapshot to check the particular key you are
looking at.


simon

2009/7/9 Chuck Hill <email@hidden>:

On Jul 9, 2009, at 10:24 AM, Lon Varscsak wrote:

Is there a way for a controller object to listen for changes to an EO
(and a specific key)?


Thanks,

Lon

EOEditingContext has ObjectsChangedInEditingContextNotification, but it
is
on an object by object basis, not a key by key one.


You could implement this in your EO super class.


Chuck

--
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@hidden) Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden




-- 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@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Listening for changes on an EO (From: Lon Varscsak <email@hidden>)
 >Re: Listening for changes on an EO (From: Chuck Hill <email@hidden>)
 >Re: Listening for changes on an EO (From: Simon McLean <email@hidden>)
 >Re: Listening for changes on an EO (From: Lon Varscsak <email@hidden>)
 >Re: Listening for changes on an EO (From: Chuck Hill <email@hidden>)
 >Re: Listening for changes on an EO (From: Lon Varscsak <email@hidden>)
 >Re: Listening for changes on an EO (From: Lon Varscsak <email@hidden>)

  • Prev by Date: Re: Listening for changes on an EO
  • Next by Date: Re: Listening for changes on an EO
  • Previous by thread: Re: Listening for changes on an EO
  • Next by thread: Wonder Loggin question
  • Index(es):
    • Date
    • Thread