Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: Understanding Catalyst

by QuillMeantTen (Friar)
on Oct 05, 2015 at 06:31 UTC ( [id://1143784]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Understanding Catalyst
in thread Understanding Catalyst

In your example, shouldn't the sub d10 live in another file than the Controller/(Root|whatever).pm?

Replies are listed 'Best First'.
Re^6: Understanding Catalyst
by Your Mother (Archbishop) on Oct 05, 2015 at 11:32 UTC

    Yes. It would either be in MyApp::Model::Dice or *much* better in a Games::Dice module that has nothing to do with MyApp and is used via model glue like Catalyst::Model::Adaptor.

    I am trying to write a reply to your original post but it’s pretty long and I might not get it done.

      via model glue like Catalyst::Model::Adaptor.

      I don't understand why that would be necessary ... it seems gratuitous

        It beats the crap out of 100 undecorated function calls and use|require statements sprinked all over the place and even embedded in the templates with contorted logic to surface instead of just being in [% c.model("WhatWhat").call %] and then something impossible to repurpose, let alone trivially change, with a simple back end swap. c.uri_for() might seem gratuitous too if you’ve never grown an app that needed testing, flexible deployment, or midstream changes that could otherwise be trivial. :P

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1143784]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-03-29 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found