Ask HN: Alternatives to MVC
I'd like to branch out from MVC for my next webapp. What battle-tested alternatives are others using?
Here's a post from 2014, but there aren't any example code bases. https://blog.ircmaxell.com/2014/11/alternatives-to-mvc.html
16 comments
[ 5.8 ms ] story [ 17.6 ms ] thread* One file (script) per route e.g. classic vanilla PHP.
* ASP.NET web forms - tries to make the web like a drag and drop windows forms application. Very nice for basic websites but doesn't scale to well if there are a lot of nested controls. Has this horrible concept called 'viewstate' where you send state about your controls in a hidden form field and post it back. This makes server side "on change" events possible for client side actions. It's horrible because Viewstate size grows quickly for complex forms, and it doesn't feel very web-like or Restful.
If you want to create a SPA, then React/Redux and Elm offer interesting patterns, but your server would still need to send data, and I can't think of anything better than an MC (no V!) type of framework for this.
>SEPARATION OF CLIENT AND SERVER
>In the REST architectural style, the implementation of the client and the implementation of the server can be done independently without each knowing about the other. This means that the code on the client side can be changed at any time without affecting the operation of the server, and the code on the server side can be changed without affecting the operation of the client.
which is kind of different from having server side "on change" events
Are you mostly doing CRUD (data-centric), or a more document-centric (CMS-like)?
In MVP, by rotating (or twisting) the MVC triad, one can produce an "Observer" based framework that is easy to use and more flexible.
Some googling and you may find more literature on the same including comparisons with MVVP.
[1] http://www.object-arts.com/downloads/papers/TwistingTheTriad...
[2] http://carfield.com.hk/document/software+design/MVP.pdf
Basically you write imperative paint functions like this example:
[0] https://guide.elm-lang.org/architecture/
[1] https://elm-lang.org/examples