
janus at errornet
Oct 8, 2008, 5:28 AM
Views: 974
Permalink
|
|
Proposal for new module: Catalyst::Plugin::Memory
|
|
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
|