I'd like to branch out from MVC for my next webapp. What battle-tested alternatives are others using?<p>Here's a post from 2014, but there aren't any example code bases. https://blog.ircmaxell.com/2014/11/alternatives-to-mvc.html
You could look into functional reactive programming as in rxjs/rxjava etc (<a href="https://medium.com/netflix-techblog/reactive-programming-in-the-netflix-api-with-rxjava-7811c3a1496a" rel="nofollow">https://medium.com/netflix-techblog/reactive-programming-in-...</a>) or command query responsibility segregation (<a href="https://microservices.io/patterns/data/cqrs.html" rel="nofollow">https://microservices.io/patterns/data/cqrs.html</a>).
If you haven't, you can look at MVP [1] and [2].<p>In MVP, by rotating (or twisting) the MVC triad, one can produce an "Observer" based framework that is easy to use and more flexible.<p>Some googling and you may find more literature on the same including comparisons with MVVP.<p>[1] <a href="http://www.object-arts.com/downloads/papers/TwistingTheTriad.PDF" rel="nofollow">http://www.object-arts.com/downloads/papers/TwistingTheTriad...</a><p>[2] <a href="http://carfield.com.hk/document/software+design/MVP.pdf" rel="nofollow">http://carfield.com.hk/document/software+design/MVP.pdf</a>
Immediate mode gui - short imgui.
For example the library "Dear imgui".<p>Basically you write imperative paint functions like this example:<p><pre><code> ImGui::Text("Hello, world %d", 123);
if (ImGui::Button("Save"))
{
// do stuff
}
ImGui::InputText("string", buf, IM_ARRAYSIZE(buf));
ImGui::SliderFloat("float", &f, 0.0f, 1.0f);</code></pre>
It depends on why. Is it for learning purposes, or some other reason? Old school (but battle tested, not great patterns for learning though):<p>* One file (script) per route e.g. classic vanilla PHP.<p>* 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.<p>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.
Microsoft has something called Razor Pages that is sort of a hybrid between MVC and Web Forms. It may be a better fit for smaller projects, but is still fairly new.<p>Are you mostly doing CRUD (data-centric), or a more document-centric (CMS-like)?
I'm ready this book right now, and it's great. <a href="https://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612/ref=mp_s_a_1_3?keywords=design+patterns&qid=1565745735&s=gateway&sprefix=design+pattern&sr=8-3" rel="nofollow">https://www.amazon.com/Design-Patterns-Elements-Reusable-Obj...</a>
One alternative: The Elm Architecture [0] is more like Model-View-Update than MVC. Examples aplenty [1].<p>[0] <a href="https://guide.elm-lang.org/architecture/" rel="nofollow">https://guide.elm-lang.org/architecture/</a><p>[1] <a href="https://elm-lang.org/examples" rel="nofollow">https://elm-lang.org/examples</a>