Comments on: Keep ‘em separated: Get better maintainability in web projects using the model-view-controller pattern https://stackoverflow.blog/2023/05/17/keep-em-separated-get-better-maintainability-in-web-projects-using-the-model-view-controller-pattern/ Essays, opinions, and advice on the act of computer programming from Stack Overflow. Sat, 27 May 2023 14:48:29 +0000 hourly 1 By: Adam Konrad https://stackoverflow.blog/2023/05/17/keep-em-separated-get-better-maintainability-in-web-projects-using-the-model-view-controller-pattern/#comment-3203480 Tue, 20 Jun 2023 02:48:00 +0000 https://stackoverflow.blog/?p=22178#comment-3203480 In reply to M.

Agreed on the OSI model 🙂

]]>
By: Jeremy H. https://stackoverflow.blog/2023/05/17/keep-em-separated-get-better-maintainability-in-web-projects-using-the-model-view-controller-pattern/#comment-3203070 Tue, 20 Jun 2023 05:15:00 +0000 https://stackoverflow.blog/?p=22178#comment-3203070 In reply to Duane Moody.

It’s probably best to think of model-view-controller (MVC) as a sort of parent concept for any kind of software application that has a user interface (UI). That’s especially true for a graphical one requiring the transformation of data into a visual representation (as opposed to outputting raw data).

Whether or not it strictly follows the definition of ‘separation of concerns’, it is ultimately concerned with separating parts of the application into one of those three categories.

But the categories could have sub categories, just as there might be core data models as well as “overlay” models that unify them into a sort of meta-model.

]]>
By: M https://stackoverflow.blog/2023/05/17/keep-em-separated-get-better-maintainability-in-web-projects-using-the-model-view-controller-pattern/#comment-3202711 Tue, 20 Jun 2023 12:36:00 +0000 https://stackoverflow.blog/?p=22178#comment-3202711 In reply to Andreas Söderlund.

Nice to see MVC still getting some press. For seperation of concerns the correct nerd term would be the OSI model where the concept of these layers came from, I believe? Would’ve been nice to see some SOA as well … I don’t agree with models performing business/application functions however. I see the model as purely a Holder layer and view model MVVM as a still relevant hybrid option for binding and transport to the view. But I typically follow a service layer ie: business logic processing tier, where the ugly code goes, which typically has access to the models and data access layer. And keep request responses and sessions,if required, in the controller tier which only takes data or requests in and passes them to services for responses. Totally agree it is just a pattern as well… But also the reason we now have specializations in front end back end and full stack…. As with greater separation comes a greater complexity ramp and it kills me that to this day tthere is still no industry standard across the board on the best way to deliver data with interactivity to any client through a network that can also exist and function offline. In search of the golden template….

]]>
By: Adam Konrad https://stackoverflow.blog/2023/05/17/keep-em-separated-get-better-maintainability-in-web-projects-using-the-model-view-controller-pattern/#comment-3202604 Tue, 20 Jun 2023 08:10:00 +0000 https://stackoverflow.blog/?p=22178#comment-3202604 In reply to Andreas Söderlund.

The focus of the article is the practical use of MVC in backend web applications. The MVC has many use-cases and implementations and my article goes in depth in one of them.

]]>
By: Andreas Söderlund https://stackoverflow.blog/2023/05/17/keep-em-separated-get-better-maintainability-in-web-projects-using-the-model-view-controller-pattern/#comment-3201849 Tue, 20 Jun 2023 09:00:00 +0000 https://stackoverflow.blog/?p=22178#comment-3201849 MVC is *not* about separation of concerns, it’s a pattern language created to align the computer and the programmer with the mental model of the end user. What you’re promoting here is a nerd-centric, simplified view of MVC that it doesn’t deserve. See the website link for the article “Rediscovering MVC” that goes into depth about this, with quotes directly from Reenskaug himself.

]]>
By: TJ https://stackoverflow.blog/2023/05/17/keep-em-separated-get-better-maintainability-in-web-projects-using-the-model-view-controller-pattern/#comment-3199729 Tue, 20 Jun 2023 05:51:00 +0000 https://stackoverflow.blog/?p=22178#comment-3199729 the middle ages called they want their music back 😉

]]>
By: Adam Konrad https://stackoverflow.blog/2023/05/17/keep-em-separated-get-better-maintainability-in-web-projects-using-the-model-view-controller-pattern/#comment-3199446 Tue, 20 Jun 2023 03:41:00 +0000 https://stackoverflow.blog/?p=22178#comment-3199446 Rails, for example, is pretty good with access control on different controller methods.

]]>
By: Duane Moody https://stackoverflow.blog/2023/05/17/keep-em-separated-get-better-maintainability-in-web-projects-using-the-model-view-controller-pattern/#comment-3199132 Tue, 20 Jun 2023 11:07:00 +0000 https://stackoverflow.blog/?p=22178#comment-3199132 MVCs simulation of directories via URL rewriting forms a conflict when an application has multiple sections each aimed at a separate audience with its own access rules. Webserver frameworks gate access based on actual filesystem subdirectories not slash-delimited URL components, and it’s not allowed in some orgs to roll your own auth just to bypass that for an application.
It’s also questionable as to whether encapsulating an entire application into a single file (either literally, or figuratively via includes) provides a benefit to development. MVC seems a reasonable solution to a medium-sized web application for which there is only one audience, but like microservices it needs to fit the problem it was meant to solve.

]]>