Do you know where your variables are? | |
PerlMonks |
Cool uses for Dancer/Mojo hooksby Dallaylaen (Chaplain) |
on Dec 13, 2016 at 17:00 UTC ( [id://1177718]=perlquestion: print w/replies, xml ) | Need Help?? |
Dallaylaen has asked for the wisdom of the Perl Monks concerning the following question: Hello dear esteemed monks, After announcing my toy web framework to a local Perl mongers group, I received a request from fellow monger to add filters. He was citing sinatra.rb as reference. I promptly found both Mojolicious and Dancer to have similar functionality called hooks. Apache/mod_perl allows to hook into different stages of request processing as well, and I was planning to do something like that as well. So I set myself on a quest to add hooks. However, the very first attempts turned out to be utterly over-engineered (almost everything I do is, see Implementing methods in a subclass or providing in-place callback: Is it overengineered?). It's easy to make a mistake, and it would be hard to correct it later. Some background: the framework goes as follows:
What I clearly want:
What I'm unsure about:
So before I proceed to answering these questions I would like to ask for example usage of this feature. Here's what I can think of:
What else did you encounter / think about doing via such hooks in real-life applications? Thank you.
Back to
Seekers of Perl Wisdom
|
|