On 18 Jul 2010, at 19:58, Alejandro Imass wrote:
So in conclusion, it seems reasonable to say that I should not worry
about the global vars (the Moose object attributes) in my Model
Instance to get overridden by the ACCEPT_CONTEXT call, as this call
will only be called once in sequence with a single request. Anyone
disagree?
Yes.
They're _still_ not global variables, they are instance variables, of
an instance which is scoped to the application lifetime.
And changing the values of them per-request is still entirely wrong,
yucky, bad design etc.
If you need an ACCEPT_CONTEXT method, than return a _different_
instance which has the mutable state, rather than smashing things in
your per-app instance and returning that.
(But yes, even if you do the thing I'm recommending against, it will
work without multiple threads stamping on each other).
Cheers
t0m
_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/