Re: Editing Context Choices
Re: Editing Context Choices
- Subject: Re: Editing Context Choices
- From: mmalcolm crawford <email@hidden>
- Date: Sun, 1 Aug 2004 15:55:24 -0700
On Aug 1, 2004, at 10:37 AM, Hunter Hillegas wrote:
I've read the documentation but even the Enterprise Objects book from
Apple doesn't seem to really explain the different kinds and when they
should be used.
I'm not sure why there should be so much confusion.
The session's default editing context is an instance of
EOEditingContext. A shared editing context is an instance of a
different class, and hence clearly... different.
An editing context represents an object "scratch pad," and your gateway
to the underlying object stores. In a typical session-based
application you'll need an editing context to interact with the EOF
stack, manage the sessions EOs etc. Given that this is a common
requirement, you have a default editing context...
Sometimes, however, you need more fine-grained control. Maybe you want
the ability to make "experimental" changes to EOs which may then either
be saved or discarded independently of other changes. In these cases
you might create a separate editing context, either a peer editing
context or a nested editing context. A separate (peer) editing context
has "issues" in synchronisation and merging changes (akin to editing
contexts in different sessions); a nested editing context is typically
more useful since it'll help keep keep things consistent:
<http://developer.apple.com/documentation/LegacyTechnologies/
WebObjects/WebObjects_4.5/System/Documentation/Developer/WebObjects/
Topics/ProgrammingTopics.39.html>
In some applications you have a small set of immutable objects that are
common to all sessions -- for example states. To prevent unnecessary
duplication, it would be useful to keep a single collection of these
objects, say in your Application object. One of the limitations,
however, of normal editing contexts is that you cannot establish
relationships between objects in different editing contexts. This
makes things difficult if you want a share set of EOs...
... hence the shared editing context.
<http://developer.apple.com/documentation/WebObjects/Reference/API/com/
webobjects/eocontrol/EOSharedEditingContext.html>
mmalc
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.