[Catalyst-dev] Proposal for new module: Catalyst::Plugin::Memory

Simon Bertrang janus at errornet.de
Wed Oct 8 13:28:02 BST 2008


Hi,
i need a way to save various kinds of information between different
points in the request chain.
Initially i abused the stash for this, but polluting the template with
data not needed there or even worse, preventing things to work as
expected, did not work out.
The session would have been another solution but the same arguments
apply there as for the templates.

What was left:
 a) accessing $c manually to hand over the data
 b) implement a controller providing a common method
 c) writing a plugin

I decided for the plugin as i need access to this data from many points
in our applications (the controllers as well as the models use
this information).
So what i'm now proposing is the module Catalyst::Plugin::Memory which
is mostly identical with the stash, except that it isn't the stash.
It allows me to capture arguments out of the chains, use them at later
points in the chain and access them from forwarded methods.

I've attached the code i've written so far but it's not done yet.  A few
tests are to be written as also as documentation.

But what do you think?  Is it conceptually ok, do you disagree with the
name (suggestions welcome) or are there any other comments i should take
into account before i finish and upload this?

Kind regards,
Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Catalyst-Plugin-Memory-0.01.tar.gz
Type: application/x-tar-gz
Size: 1706 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/catalyst-dev/attachments/20081008/6fc85126/Catalyst-Plugin-Memory-0.01.tar.bin


More information about the Catalyst-dev mailing list