{
    "href": "/post/2015/01/21/mvc-and-adr-are-user-interface-patterns-not-application-architectures/",
    "relId": "2015/01/21/mvc-and-adr-are-user-interface-patterns-not-application-architectures",
    "title": "MVC and ADR are User-Interface Patterns, Not Application Architectures",
    "author": "pmjones",
    "markup": "html",
    "tags": [
        {
            "href": "/tag/adr/",
            "relId": "adr",
            "title": "Action Domain Responder",
            "author": null,
            "created": "2020-08-17 21:07:42 UTC",
            "updated": [
                "2020-08-17 21:07:42 UTC",
                "2020-09-22 15:41:16 UTC",
                "2020-10-14 18:20:29 UTC",
                "2020-10-14 18:36:31 UTC",
                "2020-10-14 18:36:53 UTC",
                "2020-10-14 18:37:08 UTC",
                "2020-10-14 18:37:48 UTC",
                "2020-10-14 18:39:26 UTC",
                "2020-10-14 19:03:17 UTC",
                "2020-10-14 19:03:35 UTC",
                "2020-10-26 18:12:53 UTC"
            ],
            "markup": "markdown"
        },
        {
            "href": "/tag/patterns/",
            "relId": "patterns",
            "title": "Patterns",
            "author": null,
            "created": null,
            "updated": [],
            "markup": "markdown"
        },
        {
            "href": "/tag/php/",
            "relId": "php",
            "title": "PHP",
            "author": null,
            "created": null,
            "updated": [],
            "markup": "markdown"
        },
        {
            "href": "/tag/programming/",
            "relId": "programming",
            "title": "Programming",
            "author": null,
            "created": null,
            "updated": [],
            "markup": "markdown"
        }
    ],
    "created": "2015-01-21 15:54:31 UTC",
    "updated": [
        "2015-01-21 15:54:31 UTC"
    ],
    "html": "<blockquote>\n<p>N.b.: I am the author of the Action-Domain-Responder paper referenced in this article.</p>\n</blockquote>\n<p>In his post on <a href=\"http://blog.ircmaxell.com/2014/11/alternatives-to-mvc.html\">MVC alternatives</a> (including <a href=\"http://pmjones.github.io/adr\">Action-Domain-Responder</a>), Anthony Ferrara makes a claim that is central to his discussion. While I agree with much he says in that and related articles, I believe that one claim is in error, and while it does not discredit the essay as a whole, replacing the erroneous claim with a more accurate one gives the essay a different flavor.</p>\n<p>The central mistake I think Anthony makes is <a href=\"https://blog.ircmaxell.com/2014/11/alternatives-to-mvc.html#All-Pretend-To-Be-Application-Architectures\">near the end of his post</a>, where he states (in talking about MVC, ADR, et al.) that \u201cAll Pretend To Be Application Architectures.\u201d  That assertion strikes me as incorrect.</p>\n<p>While it may be that <em>developers using MVC</em> may mistakenly think of MVC as an application architecture, <a href=\"http://martinfowler.com/eaaCatalog/modelViewController.html\">the pattern description itself</a> makes no such claim. Indeed, <a href=\"http://martinfowler.com/eaaCatalog/\">Fowler categorizes MVC as a \u201cWeb Presentation Pattern\u201d</a> and not as an \u201cApplication Architecture\u201d per se.</p>\n<p>Sure, MVC is described in book called <a href=\"http://www.amazon.com/Patterns-Enterprise-Application-Architecture-Martin/dp/0321127420/\">\u201cPatterns of Enterprise Application Architecture\u201d</a>, but MVC itself is a presentation pattern within an application architecture. Here\u2019s another example of the distinction: we would not call \u201cTable Data Gateway\u201d an application architecture, even though it too appears in the same book. It is a data source pattern within an application architecture.</p>\n<p>Fowler's categorization and description of MVC define it pretty clearly as a user interface pattern. ADR, as a refinement of MVC, is likewise a user interface pattern. Neither is an application architecture in and of itself, although they are the outermost part of an application architecture. So when Anthony\u2019s article states elsewhere that ADR\u2019s \u201ccoupling to HTTP that it becomes difficult to make a non-HTTP interface\u201d my response is \u201cWell, obviously \u2013 it\u2019s a user interface pattern centered around HTTP.\u201d</p>\n<p>Anthony then goes on to say:</p>\n<blockquote>\n<p>And that\u2019s the biggest reason all of these \u201cpatterns\u201d, \u201carchitectures\u201d and \u201cconcepts\u201d are a bad joke. They solve the easy problem, and throw the hard problem over the fence.</p>\n</blockquote>\n<p>MVC, ADR, et al., solve a user-interface problem. That may be an easy problem for Anthony to solve, but to say that user-interface patterns \u201cthrow the hard problem over the fence\u201d strikes me as starting from the wrong set of expectations.  MVC and ADR, as user-interface patterns, aren\u2019t supposed to be dealing with core business logic in the first place.</p>\n<p>It might be better to say that the underlying application that is presented through the user interface is not really the user interface\u2019s problem in the first place. The user interface code probably should not care too much about the internal operation of the underlying application code. If it does, then the application code is bubbling up too far into the user interface.</p>\n<p>In summary, I think the assertion that \u201cAll Pretend To Be Application Architectures\u201d is just not an accurate categorization.  It would more correct to say that \u201cAll Are User Interface Patterns, Not Entire Application Architectures\u201d \u2013 or, even better, that \u201cDevelopers Frequently Misunderstand Them To Be Application Architectures\u201d.</p>\n<hr>\n<p class=\"reddit-links\">Read the Reddit discussion about this post <a href=\"https://www.reddit.com/r/PHP/comments/2t6i66/mvc_and_adr_are_userinterface_patterns_not/\">here</a>.</p>\n"
}
