Should I build my next web app in ASP.NET MVC?

前端 未结 7 1930
情书的邮戳
情书的邮戳 2021-02-14 23:20

My team is considering building our next web app using the ASP.NET MVC framework. I am slightly hesitant, as are some others, because it is still only in beta. I really want t

7条回答
  •  北荒
    北荒 (楼主)
    2021-02-15 00:21

    It's a pretty simple decision tree, really.

    Choose ASP.NET MVC if you...

    • Care deeply about URLs
    • Care deeply about your HTML
    • Want true separation of concerns
    • Want testability through and through
    • Want flexibility of view engines (ASPX, NVelocity, NHaml, etc)

    Choose WebForms if you...

    • Enjoy the stateful abstraction of WebForms (ViewState)
    • Don't mind PostBack model
    • Prefer components that you can "drag & drop" on a page

    For me, the answer will 99% be ASP.NET MVC, because I think it is a much better match for the web. I think the ajax story is much cleaner as well, and I have complete control over my HTML & URLs. On top of all of that, I can test-drive my website (controllers) quite easily.

    Yes, I know you can achieve clean URLs in WebForms, and you can have clean(er) HTML through Control Adapters, and you can achieve a level of testability with the MVP pattern in WebForms, but these are all off-the-beaten path approaches. With ASP.NET MVC this stuff is core. That's just the way you do it.

    And don't worry about the preview/beta status. The team has always maintained that you don't need a go-live license to deploy it (even though they now offer one). It's purely additive on the existing ASP.NET Runtime.

    It's like automatic vs. manual transmission. Pick one that makes you happy and run with it.

提交回复
热议问题