Re: Webobjects design: multiple editing contexts
Re: Webobjects design: multiple editing contexts
- Subject: Re: Webobjects design: multiple editing contexts
- From: Kieran Kelleher <email@hidden>
- Date: Tue, 24 Mar 2009 09:24:41 -0400
In any case, I am a believer of doing all initialization lazily in
WOComponents ... then you don't have to think about the RR cycle and
if/when you object needs to be initialized
private EOEditingContext _editingContext;
public EOEditingContext editingContext() {
if (_editingContext == null) {
_editingContext = ERXEC.newEditingContext();
}
return _editingContext;
}
HTH, Kieran
PS. If you are going to Multiple EC's, I recommend you use Project
Wonder and the safeLocking settings ....... if not using Wonder, then
google for MultiECLocker or whatever it is called.
On Mar 24, 2009, at 8:44 AM, Mark Wardle wrote:
Hi all.
I'm pretty happy with the mechanics of WO now... but I sometimes feel
I'm "doing the wrong thing" in some aspect of design/architecture.
I am making the leap to using multiple editing contexts (using PW).
I'm using component actions exclusively at present.
When is the appropriate time to create an editingcontext - within a
component's constructor? If so, is it appropriate to pass a handle to
the editingcontext between components? For example, I have a UserEdit
component, that takes a User as a binding, and allows a user to edit
that user's details (subject to permissions). At present, I have a
constructor that creates a new editingcontext, and any setters that
use EOs are careful to get a copy of the EO in the correct
editingcontext.
What if I then have subcomponents that need to use the parent editing
context? Is it appropriate to get the parent's editingcontext from the
EO itself?
Once I start thinking about that, it looks like I'm writing lots of
code which is fairly repetitive and thought that there must be a
better way? Am I missing something obvious? I don't want to make
things highly modal, and I usually don't wish to preserve state
between components unless the user specifically requests it.
Any design tips gratefully received!
--
Dr. Mark Wardle
Specialist registrar, Neurology
Cardiff, UK
_______________________________________________
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
_______________________________________________
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