Slashdot Mirror


Model-View-Controller — Misunderstood and Misused

paradox1x writes "Malcolm Tredinnick shares a terrific rant against the misunderstanding and misuse of the Model-View-Controller design pattern. In particular he takes issue with the notion that Django should be considered an MVC framework. He says that 'It's as valid as saying it's a "circus support mechanism," since the statement is both true, in some contexts, and false in others (you can definitely use Django-based code to help run your circus; stop looking so skeptical).' I'm not sure I agree with the entire piece, but it is a very good read." We recently discussed another look at the bending and stretching of MVC patterns in the world of Web development.

12 of 221 comments (clear)

  1. Pedantry by Anonymous Coward · · Score: 5, Insightful

    So let me get this straight: you're upset because some developers are misusing a term and giving their product more credit than it should have?

    Well, that's never happened before!

  2. Web Frameworks by truthsearch · · Score: 4, Insightful

    The custom web framework my company uses helps program with the MVC pattern, but doesn't enforce it. Some developers are very consistent with separating the model, templating, and control structure. Some developers (not always the less experienced ones) often intermingle functionality and don't realize they're no longer within the MVC design. So our framework is nice that it's flexible, but it also will let you hang yourself. Most other frameworks, at least for PHP and Python, seem to be the same way.

  3. Author is Pedantic by iluvcapra · · Score: 5, Insightful

    And does quite a bit of complaining about Django without completely demonstrating his point. I'm still foggy about his complete idea of what he believes the original interpretation of a "Controller" is, which is really the heart of the matter and where most people seem to disagree. His "model" of what MVC is is not explicated in his view, as represented by his blog post.

    MVC is a pattern, not a set of rules, a coding style, house style, development framework, or development process. If you have three modules, one doing presentation, one doing state, and one mediating, you're doing MVC. What specific functions go where (is sorting on the model? is validation of this field in the view?) is specific to the problem domain.

    IMHO

    --
    Don't blame me, I voted for Baltar.
    1. Re:Author is Pedantic by lgw · · Score: 4, Interesting

      Old-school developers liek myself have a significant problem with Design Pattern: they're new and confusing names for old ideas. Almost everything in the Gang of Four's book, for example, was some work-around for some limitation of C++. For example, I have to look up what the "strategy" pattern means, but I know how to pass a function in a language with first-class functions.

      To anyone with a strong grounding in Computer Science, the Strategy pattern doesn't need a name - it's simply "The picture processing code of images takes a function as input".

      And in any case mostof the fresh college hires I work with don't know what the "Stategy" pattern is (without looking it up) *either*, so giving it a name doesn't help the conversation at all. But I can tell them "don't hard-code your algorithm choices in a switch-case, store a pointer (function pointer, interface-typed pointer, whatever) as a member and call that" they understand both *what* I'm talking about and *why*.

      With MVC in particular, it's received wisdom that all good GUI code is MVC, so of course all GUI code will be documented as ussing MVC. The clarity of term has been destroyed by the hype.

      --
      Socialism: a lie told by totalitarians and believed by fools.
  4. wait a second! by girlintraining · · Score: 4, Funny

    Wait a second, there's programmers that aren't using only pure algorithms, refined from the finest electrons, bred from the keyboard controller outputs of Bjarne Stroustroup himself? Well damn, standards are just slipping everywhere. What next, thinking of the web as a platform? Client-side security? Linux on the desktop?

    --
    #fuckbeta #iamslashdot #dicemustdie
    1. Re:wait a second! by mmkkbb · · Score: 5, Funny

      The purest algorithms never touch a keyboard; only pencil, paper, and thought.

      --
      -mkb
    2. Re:wait a second! by JCSoRocks · · Score: 4, Funny

      No thought indeed. They really only involve butterfly wings flapping.

      --
      You are using English. Please learn the difference between loose and lose; they're, there, and their; your and you're.
  5. huh? by larry+bagina · · Score: 5, Funny

    Since when did they let long winded douchebags with nothing to say have blogs?

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  6. I like the prologue by mattdm · · Score: 4, Funny

    As I started reading, I discovered I don't care enough to read the whole thing.

    But I thought the beginning was awesome: "You can disagree with me only if you are wrong."

  7. Django by styrotech · · Score: 5, Insightful

    I was under the impression that the Django team don't consider it to be MVC themselves, but they've just given up the losing battle of explaining the difference to the masses who think that MVC is the only good way you can arrange 3 different tiers of an application. So they've shrugged their shoulders and effectively said "Fine. If you want Django to be MVC, it is MVC. Now drop it and let us get back to developing it.".

    1. Re:Django by Fallingcow · · Score: 4, Informative

      There's some evidence for that in their naming of the application layers:

      Model
      Template
      View

  8. Re:Wrong. by plover · · Score: 5, Funny

    Author is Pedantic

    No he isn't. He critisizes the incorrect use and application of the term MVC and the misconception and the pointless enforcement of a wrong concept of MVC in places where it is often more than pointless to do so. Like in most modern web application scenarious.

    I think you just pretty much quoted the dictionary definition of a pedant, specifically definition 2B.

    Rather a lot like I'm doing now. </pedantic>

    --
    John