What about the EOObjectsChangedInEditingContextNotification?

This notification is broadcast whenever changes are made in an EOEditingContext. It's similar to ObjectsChangedInStoreNotification, except that it contains objects rather than globalIDs.
...
Interface layer EODisplayGroups (not WebObjects WODisplayGroups) listen for this notification to redisplay their contents


That sounds like it may do what you want and send fewer notifications. IIRC, it is called at the end of the RR loop in a WO app, not sure about JC. I think this is part of what the processRecentChanges() or _processRecentChanges() method does.


Chuck


On Jan 7, 2008, at 7:55 AM, Florijan Stamenkovic wrote:

Guido,

Thanks for the reply. I do not need this for logging. Where I need it in are Java Client applications. I am just finishing up a library that will make it quite easy to build WO + Swing applications. The library is totally event driven, all the GUI controllers and all that stuff has been made to respond to events fired by EOs that have changed. So, the end purpose is keeping the GUI in synch with the current state of EOs.

So, if the changes in the end get saved to the database or not is not relevant in my scenario.

That being said, what do you think? Till now my solution was to use EOGenerator to define setters that take care of event firing, when needed. This works, but I always wanted to do this more elegantly, and overriding the mentioned methods seems just about right. I am just wondering if EOF can at any time for any reason bypass them. Reading the API makes me think it can not, but I wanted to check...

Flor

On Jan 06, 2008, at 19:03, Guido Neitzer wrote:

On 06.01.2008, at 15:53, Florijan Stamenkovic wrote:

I am trying to make an EOGenericRecord subclass that will automatically fire events when new values are set. It is imperative that the event firing is absolute, nothing can be allowed to slip by, if a property changes in any way, an event has to be fired.

Hmm. Do you want to log the change in the EO or the change in the database? Because if you log changes to the EO, you might end up with logged stuff that was never saved and therfor does not exist outside the scope of where the change happened (and was reverted).

What I did for logging changes to EOs was checkin in "willUpdate" (using Wonder) by getting the changes from the snapshot. I also have some code to check whether relationships change but that is not really thought out completely.

cug

--
http://www.event-s.net


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill% 40global-village.net

This email sent to [EMAIL PROTECTED]


--

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      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to