Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC suitable to complex web application?

Last week , my boss ask my team to evaluate ASP.NET MVC, for next project. all of us working with webform since .NET 1.1, we have no MVC experience before ,but all of my colleagues are interested in ASP.NET MVC ,But no luck , our finally answer is NO.

Because:

  1. We believe although you are ASP.NET Guru, you can build a complex application in short amount of time. But if you change to ASP.NET MVC, the development time will take longer, every things need to using html helper, no web control, and many question ,keep opening the Firefox Tab with ASP.NET forum for ask How-To question.

  2. We had see many times people say MVC provide better project management , but if it is a complex web site, I can imagine there are hundred <%=%> TAGs in one page, and keep open controller to see what to return, and keep opening model to see the logic.

I can say , MVC is not bad, but Webform is strong enough to handle the job.

like image 362
Cheung Avatar asked Apr 06 '09 17:04

Cheung


People also ask

Is MVC suitable for both Windows and web applications?

Is MVC suitable for both Windows and Web applications? The MVC architecture is suited for a web application than Windows. For Window applications, MVP, i.e., “Model View Presenter” is more applicable.

What are the advantages of MVC over traditional ASP Net webform application?

The MVC framework provides a clean separation of the UI , Business Logic , Model or Data. On the other hand we can say it provides Sepration of Program logic from the User Interface. More Control-The ASP.NET MVC framework provides more control over the HTML , JavaScript and CSS than the traditional Web Forms.


1 Answers

It will take several weeks to change over to a new technology, or a "way of thinking".

With MVC, you have to get away from old ASP.NET Forms way of thinking "complex web application" in that "how many pages we have, over 300 pages! that would be huge!". You change the view of your entire application. You shift from old thinking of "what page need to create next" to the MVC way of thinking of "what function do we need to implement next".

For example, I myself took control of a project that has over 3300 files in the 'web' project alone (plus the 11 supporting assemblies). One thing that I am architecting is how MVC will drastically cut down the number of physical files down to around 310 or so. How? Because I am moving away from "here's one page. Here's another page." to a "here's the function I want to implement" way of thinking.

By looking at pages as the function you are trying to accomplish, you instead start abstracting pieces of that page out into common functionality.

MVC can greatly scale with this way-of-thinking because now you have a template for the way you want it to look, you just need to implement another "function" to change the look of that View (html) you want to render. No 2nd page, no additional controls, etc.

Now, as for "no web controls" as you mentioned: again, this calls for a different way of thinking. There is the HtmlHelper that is used for basic rendering and encoding. I use the same concept with an abstracted class called MyProjectHelper that renders my "functions" onto the page (functions=code).

For example, I always created a Server Control for my DisplayNames in the past. This allowed me to control the way that DisplayName was shown, especially with a switch to Facebook Connect and other things. With MVC, I no longer use a "server control", but a "function" on a ViewModel to render that text: CollegeProjectViewModel.RenderDisplayName(). Since this is only part of the UI layer, this will render the Anchor as needed with any options I wish (of course, the abstract is inherited by the CollegeProjectViewModel that picks up on the "basic" text rendering).

MVC's power lies in the ability to no longer require a "webpage", but instead "functions" or methods of what you want to do with your site. By changing to this way of thinking, you really can scale with as many method you create on your Controllers. It really speeds things up on a mass scale IMO.

like image 83
eduncan911 Avatar answered Nov 27 '22 16:11

eduncan911