Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
If that's so ... it also means that I must update each member separately, even if I want to make the same update to each ... more hassle than it's worth?

Not necessarily, the first thing is, MVC is one of those buzzwords (just like OOP) where multiple definitions apply. Asking "how do I do MVC" is like asking "how do I do arithmetic?"

Since you are looking for practical "nuts and bolts" responses, the best approach would probably be to just understand the 'axioms' of MVC (which it seems you do) then just start coding or looking at code. Do a search for "Template::Toolkit", "Catalyst", "Smarty Templates", "Velocity", "Ruby on Rails", (etc) ... and *avoid* searching on just "MVC". The former will tend to give you 'nuts and bolts', the latter will tend to give you 'ivory tower'.

As far as your question about the "hassle", one way to avoid it is to simply define the properties of your User object in one place, and then use reflection in your View components to automatically spit out a view. This still preserves the vaunted MVC separation while minimizing the number of breaking changes for things like adding and deleting members (or fields).


=oQDlNWYsBHI5JXZ2VGIulGIlJXYgQkUPxEIlhGdgY2bgMXZ5VGIlhGV

In reply to Re: Implementing Model-View-Controller by dimar
in thread Implementing Model-View-Controller by ghferrari

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 contemplating the Monastery: (3)
As of 2024-04-18 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found