Re: Editing Context Choices
Re: Editing Context Choices
- Subject: Re: Editing Context Choices
- From: Hunter Hillegas <email@hidden>
- Date: Sun, 1 Aug 2004 16:09:43 -0700
Thanks for the reply.
I haven't seen a document that explained each type and maybe gave some
examples of best uses for each... For instance, if I have a bunch of
data that is read-mostly and accessed often, which editing context
should I use? Shared and stored in the Application? Session and looked
up each time? What are the pros and cons?
Really just looking for some kind of 'WebObjects Best Practices' I
guess.
PS - I never would have even thought to look in the doco for older
versions of WO. Interesting.
On Aug 1, 2004, at 3:55 PM, mmalcolm crawford wrote:
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.