Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Abstract: Should I choose ASP.Net MVC over Web Forms or [closed]

I've been working with web for over 7 yrs and I've upgraded from html->ASP->ASP.Net and now the new flavors of ASP.Net itself. I was to begin with MVC last year but due to deadline and the complexity involved in MVC I couldn't. Now, once again there's a new upgrade - I've begun with the ASP.Net DD (Dynamic Data) Templates (the latest one which scaffolds the DB tables and gives a list, details, edit & delete wizard).

As I dig in I get to know that its based on MVC and so I'm going to be using MVC (via DD) to built my web-apps. I've reviewed many articles and comparison videos between MVC & Web-Forms. There're a lot of topics even on SO, my abstract links are in the below reference section. Indeed MVC proves to be a more 'controlled' and 'extensible' web-development pattern however, as some say Web Forms still resides beside it (like for building a heavy data-driven apps, etc.. i.e. Sharepoint)

My web solutions are for supply-chain (user has to login to proced) and so I don't need the features of SEO or other things useful for a typical web. To simplify, I do some inventory maintenance (view, add/edit, delete & link) screens and a few complex screens like parent-child Grids & some tabular layouts. The goal remains to keep things simple yet appealing and @ the core we've performance & usability (most work with least clicks)

So, here're few of my doubts as a newbie MVCian:

  • Web forms is event driven where as MVC will do this via Actions defined in Controllers
  • It doesn't matter whether I use L2S or EF, my business logic goes in model (also extended by partial classes)
  • URL-Routing will extend my power beyond the traditional Querystring approach
  • I'll be able to render my cascaded complex tabular layouts & Grids by using multiple views (i.e. partial views & user-controls)
  • Things like sub-total, Grand-total, etc.. kind of calculations will be possible in views (hope views can share / pass data mutually)
  • Some funky GUI features like Frozen Grid-header/footer, scrolling rows, tab-view, etc.. won't lead me to a messy view (or atleast this is feasible in a clean/organized fashion)
  • I won't really have a 'Viewstate' - in that case where to store temp data? like current pageindex, sort order, etc..
  • I'm afraid MVC might lead to a complex\lenghty system where the flow is lengthy. Will I get lost? Is it scalable if I organize well?

Actually, theres more but I hope based on the above Qs you experts can figure out the kind of web-apps I work and so I just want to start investing in something better. Can't afford to change the architecture/approach every 6 months!

Does DD make MVC implicit? Then how can it use web-form controls? Sorry if I'm confusing, in that case please correct me!(most work with least clicks)

Finally, Can this be a solution: http://www.hanselman.com/blog/PlugInHybridsASPNETWebFormsAndASPMVCAndASPNETDynamicDataSideBySide.aspx


Also see the EDIT section.

Reference urls: (hope this helps others like me)

Some good refs about MVC over web-froms & comparison -

http://forums.asp.net/t/1459417.aspx (benefits of MVC over a well designed web forms application) http://www.matthidinger.com/archive/2010/02/17/why-i-love-asp.net-mvc.aspx

Fire in the hole :-) http://codebetter.com/blogs/karlseguin/archive/2010/03/11/webforms-vs-mvc-again.aspx http://www.codethinked.com/post/2010/0 http://www.codethinked.com/post/2010/01/22/Controls-Do-Not-Make-You-More-Productive.aspx


Some more views on this debate:

v.good article: http://msdn.microsoft.com/en-us/magazine/dd942833.aspx

Summary of above: http://mvark.blogspot.com/2009/08/aspnet-mvc-vs-web-forms.html

http://www.asp.net/mvc/tutorials/asp-net-mvc-overview--cs http://weblogs.asp.net/shijuvarghese/archive/2008/07/09/asp-net-mvc-vs-asp-net-web-form.aspx http://codebetter.com/blogs/karlseguin/archive/2010/03/11/webforms-vs-mvc-again.aspx

From SO:

http://stackoverflow.com/questions/30067/
http://stackoverflow.com/questions/361620/asp-net-mvc-vs-webforms-for-first-page-load-speed-for-big-projects/
http://stackoverflow.com/questions/712220/whats-your-choice-for-your-next-asp-net-project-webforms-or-mvc/
http://stackoverflow.com/questions/661181/asp-net-mvc-vs-webforms/
http://stackoverflow.com/questions/1035642/asp-net-mvc-vs-webforms-speed-and-architecture-comparison/
http://stackoverflow.com/questions/837831/mvc-versus-webforms/

EDIT #1:

Thanks for expert comments and review. I'd like to share some of my screens - if anyone is interested to let you know the kind of GUI features and Grid-cascading I've been using -

alt textalt textalt text

Plz do not confuse me witha newbie web-dvpr. I'm experienced I just need to know (like when I say "Will I be lost") whether achieving a feature rich GUI is achievable and how was your experience in doing such things .. hope that helps :-)

like image 831
Hemant Tank Avatar asked Sep 23 '10 12:09

Hemant Tank


1 Answers

I'm afraid MVC might lead to a complex\lengthy system where the flow is lengthy. Will I get lost? Is it scalable if I organize well?

Well, part of that depends on how quickly you pick up the technology.

Overall, ASP.NET MVC is just as scalable as any WebForms solution, and, in my limited experience, probably even more so. You have to remember that MVC is a pattern that is not new - it has been utilized by application developers for years. It is not even really ALL that new to web development, although ASP.NET MVC makes it very easy to do which is one of its appeals.

Some of the traditional advantages of ASP.NET MVC, such as testability for example, go a long way to making the overall project easier to maintain and quicker to build. I built my first ASP.NET MVC website within a week's time, hooking into libraries that had been developed years before, but providing a front-end web-interface. It really was that simple.

The question you asked of: "Will I get lost?" really depends on you and the application you are developing, but only you can answer that. You do have to be willing to put time into learning and understanding MVC...because you are coming from a WebForms background, there will be changes that won't be familiar to you.

Either way, I personally recommend the use of MVC, but, as always, it depends on your project needs.

Update: My own experience with MVC has been extremely positive. I know and understand WebForms just because of using it for the past few years, but I recently started a project at my company and, because I was given the leeway to choose the technologies that I wished to use, I decided it would be interesting to try the MVC model within a web application (the web application is a requirement). My team and I had experience with MVC in desktop applications, but we were all inexperienced with web development in general (as a whole).

The ASP.NET MVC experience was extremely smooth and it was an easy transition for my team to make. I ordered some books for the team, we spent a bit of time coming up to speed in our understanding, and we then began to develop (requirements had already been completed before this step - we were at implementation phase). Like I said previously, it took a week and we had already made great leaps forward - productivity was, and still is, very high. I am very pleased with the MVC model.

You appear to be concerned that the MVC model is going to cause your application to turn into a pile of mush, or to become unwieldy to maintain. As a whole, this is far from the truth. The entire idea of separated concerns makes MVC ideal for scalability of an application, as well as increasing its maintainability and testability. With that said, a lot of how well the application grows depends on your team's understanding of the MVC paradigm and their skills as developers. MVC is not for everybody, nor is it for every project. There are also many other factors to take into consideration with respect to scalability that has nothing to do specifically with MVC (design of the database for example has a HUGE impact - probably more than whatever development paradigm you choose). I personally like ASP.NET MVC, and have had a very good experience with it, but you have to take into consideration all the aspects of your project (team members, time allotted, budget, etc) to make a final decision.

like image 184
JasCav Avatar answered Oct 29 '22 17:10

JasCav