Re: best practice?
Re: best practice?
- Subject: Re: best practice?
- From: Guido Neitzer <email@hidden>
- Date: Sun, 5 Oct 2008 10:13:14 -0600
On 05.10.2008, at 08:36, WebObjects wrote:
Hello, I was wondering, what is the best way to do the login of a
user into the system.
to keep track of the username and password on the Session, or
somewhere else?
We store the user object in a the session ivar and push it to the
ERXThreadStorage in session.awake(), so it's available everywhere we
need it.
also I was reading this info : http://wiki.objectstyle.org/confluence/display/WONDER/Using+a+custom+EOEditingContext+(ERXEC)+Subclass
trying to follow the advice of some people, to do not use the
session().defaultEditingContext; so the only thing I should do is
that what is says there?
Ah, no. These are two different things.
The editing context you get from session().defaultEditingContext() is
just a normal editing context where the session conveniently takes
care of locking and unlocking it. Nevertheless it is a central thing
you might not want to use for everything.
If you want to get a separate editing context, you just do:#
EOEditingContext editingContext = ERXEC.newEditingContext();
This will give you a new peer editing context. If you use ERXEC
autolocking (and you should, check the example Properties in
ERExtensions), this editing context will get locked and unlocked for
you.
Now you can look at editing contexts as "sandboxes" to work with
objects in this editing context without affecting other parts of the
application.
You can create editingContext subclasses if you want specific
behaviour, but I never had the need to create one.
cug
--
Real World WebObjects Bootcamp at the Big Nerd Ranch:
http://www.bignerdranch.com/classes/real-world_webobjects.shtml
_______________________________________________
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