Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Thank you for letting me know about MVC. And for note, my code does not use the Mediator pattern (you've allowed your boundary definitions to infer my usage patterns based on my, probably poor, brief summary of coding practice).

Back to the OPs original question: how do you pass data to your templates? While our off-shoot discussion of MVC is interesting, it isn't answering the question. Your first response to the OP implied that the template IS the view (he asked how to prepare data to pass to the template, you replied he shouldn't do that as the view's job is to serialize the data, thus implying the template IS the view). My answer to the question was, don't pass objects. Hopefully that is clear. Where the data passed gets prepared is another question.

You'll remember I said that the lines of where the view begins is actually a subject of debate. Some pedantically apply it only to the template (such as your earlier post suggests). Some argue that the view begins with a view encapsulating module (such as your later posts have suggested). Others give the view little more recognition that a few subs.

My quip about SEVCA was aimed at people who pass objects to their templates, treating their templates as the entire view. You are welcome to do so, the template engines available are certainly powerful enough for you to do so, and I can't argue against your usage of it, but I will never recommend passing objects to your templates. I avoid doing so. What I pass to the template is a contract. If I don't establish the contract, the template will take me for all I'm worth.

I apologize to the OP for getting caught up in the MVC discussion. One of my strongest issues with Catalyst is that it is set upon strict MVC - but everybody has different feelings for MVC boundaries and implementations. As example: pedantic MVC would require at least three classes/modules to request an email address and send an email, while observation would show you can do valid MVC with three subroutines, if one looks at patterns. Life is too short to worry about whether a solution is academically correct in the Computer Science sense, or where a solution gets the job done and is maintainable in the Programming is craft sense. Sometimes we are lucky and it is both.

As an aside, to help discredit myself even more, I do not use DBIC or other ORMs. I do not know if it is related, but I have never had to create a View Serialization class (the thought of being in a situation that would require it tires me).

On the last note, I have enjoyed your posts. You seem to have a very good working knowledge. ++

my @a=qw(random brilliant braindead); print $a[rand(@a)];

In reply to Re^3: How to organize Catalyst stash (starting SEVCA) by Rhandom
in thread How to organize Catalyst stash by roman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-29 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found