TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Alternatives to MVC

25 pointsby perspective1almost 6 years ago
I&#x27;d like to branch out from MVC for my next webapp. What battle-tested alternatives are others using?<p>Here&#x27;s a post from 2014, but there aren&#x27;t any example code bases. https:&#x2F;&#x2F;blog.ircmaxell.com&#x2F;2014&#x2F;11&#x2F;alternatives-to-mvc.html

10 comments

davidjnelsonalmost 6 years ago
You could look into functional reactive programming as in rxjs&#x2F;rxjava etc (<a href="https:&#x2F;&#x2F;medium.com&#x2F;netflix-techblog&#x2F;reactive-programming-in-the-netflix-api-with-rxjava-7811c3a1496a" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;netflix-techblog&#x2F;reactive-programming-in-...</a>) or command query responsibility segregation (<a href="https:&#x2F;&#x2F;microservices.io&#x2F;patterns&#x2F;data&#x2F;cqrs.html" rel="nofollow">https:&#x2F;&#x2F;microservices.io&#x2F;patterns&#x2F;data&#x2F;cqrs.html</a>).
deepaksurtialmost 6 years ago
If you haven&#x27;t, you can look at MVP [1] and [2].<p>In MVP, by rotating (or twisting) the MVC triad, one can produce an &quot;Observer&quot; 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:&#x2F;&#x2F;www.object-arts.com&#x2F;downloads&#x2F;papers&#x2F;TwistingTheTriad.PDF" rel="nofollow">http:&#x2F;&#x2F;www.object-arts.com&#x2F;downloads&#x2F;papers&#x2F;TwistingTheTriad...</a><p>[2] <a href="http:&#x2F;&#x2F;carfield.com.hk&#x2F;document&#x2F;software+design&#x2F;MVP.pdf" rel="nofollow">http:&#x2F;&#x2F;carfield.com.hk&#x2F;document&#x2F;software+design&#x2F;MVP.pdf</a>
xaedesalmost 6 years ago
Immediate mode gui - short imgui. For example the library &quot;Dear imgui&quot;.<p>Basically you write imperative paint functions like this example:<p><pre><code> ImGui::Text(&quot;Hello, world %d&quot;, 123); if (ImGui::Button(&quot;Save&quot;)) { &#x2F;&#x2F; do stuff } ImGui::InputText(&quot;string&quot;, buf, IM_ARRAYSIZE(buf)); ImGui::SliderFloat(&quot;float&quot;, &amp;f, 0.0f, 1.0f);</code></pre>
quickthrower2almost 6 years ago
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&#x27;t scale to well if there are a lot of nested controls. Has this horrible concept called &#x27;viewstate&#x27; where you send state about your controls in a hidden form field and post it back. This makes server side &quot;on change&quot; events possible for client side actions. It&#x27;s horrible because Viewstate size grows quickly for complex forms, and it doesn&#x27;t feel very web-like or Restful.<p>If you want to create a SPA, then React&#x2F;Redux and Elm offer interesting patterns, but your server would still need to send data, and I can&#x27;t think of anything better than an MC (no V!) type of framework for this.
评论 #20691718 未加载
评论 #20691212 未加载
tabtabalmost 6 years ago
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)?
sebschollalmost 6 years ago
I&#x27;m ready this book right now, and it&#x27;s great. <a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;Design-Patterns-Elements-Reusable-Object-Oriented&#x2F;dp&#x2F;0201633612&#x2F;ref=mp_s_a_1_3?keywords=design+patterns&amp;qid=1565745735&amp;s=gateway&amp;sprefix=design+pattern&amp;sr=8-3" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;Design-Patterns-Elements-Reusable-Obj...</a>
arh68almost 6 years ago
One alternative: The Elm Architecture [0] is more like Model-View-Update than MVC. Examples aplenty [1].<p>[0] <a href="https:&#x2F;&#x2F;guide.elm-lang.org&#x2F;architecture&#x2F;" rel="nofollow">https:&#x2F;&#x2F;guide.elm-lang.org&#x2F;architecture&#x2F;</a><p>[1] <a href="https:&#x2F;&#x2F;elm-lang.org&#x2F;examples" rel="nofollow">https:&#x2F;&#x2F;elm-lang.org&#x2F;examples</a>
throwaway5d097almost 6 years ago
&quot;View oriented&quot; like <a href="https:&#x2F;&#x2F;www.liftweb.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.liftweb.net&#x2F;</a>
fgonzagalmost 6 years ago
I&#x27;m quite fond of the Ports and Adapters &#x2F; Hexagonal architecture.
dragonwriteralmost 6 years ago
Well, MVVM is a battle tested alternative to MVC.