On Oct 30, 2008, at 6:14 PM, Ken Anderson wrote:

Since it's not likely that all objects that you need to update are in the EC, I wouldn't depend on any observer paradigms.

When I have dependency situations like that, I usually update them in my 'finalize' set of methods. My base EO has 3 methods:

finalizeForInsert
finalizeForUpdate
finalizeForDelete

My editing context subclass iterates all EOs to be saved and sends the appropriate methods. Since I'm OK with the idea of modifying data in these methods and/or adding new objects, I keep track of all the objects that have already been sent finalize and loop until all objects have had the method called. I'm pretty sure Chuck and Sacha has a similar structure in their book.

Yes, we do. ERXEC also has a similar structure. I am not sure why I did not think of this before, but it might be what Dave needs, unless this needs to be updated prior to save.



Chuck


Anyway, I override these methods in subclasses that need to know when something changed, and do "the right thing". If the objects that you need to update aren't in memory, you load/fault them. The nice thing with this methodology is, everything gets saved in the same commit, so either everything makes it, or nothing does.

Ken

On Oct 30, 2008, at 3:04 PM, Andrew Lindesay wrote:

Hello David;

I use the 'ObjectsChangedInEditingContextNotification' in sub- entities to update the modifiedTimestamp in major-entities. This works really well for me.

cheers.

I have several places in my application where a large number of EOs exist in the DB that are directly dependent upon other EOs. If the depended-upon EOs change, then all the dependent EOs may need to be updated.

___
Andrew Lindesay
www.lindesay.co.nz

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

This email sent to [EMAIL PROTECTED]

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

This email sent to [EMAIL PROTECTED]


--
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 protected])
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