Jump to content

ASP.NET vs. ASP.NET MVC


skaterdav85

Recommended Posts

I'm interested in learning asp.net and I keep seeing it referred to as asp.net mvc. I'm familiar with MVC as I have done some web development using a php framework and jsp/java/struts development. My question is, should i start learning the asp.net mvc framework while i dive into .net or should I start out learning asp.net without mvc first? I was under the impression that asp.net forced you to write apps using the mvc pattern, similar to the use of jsp, java, and servlets.

Link to comment
Share on other sites

  • 3 weeks later...

You can learn which ever you like but I would go with MVC. It just seems much more natural. I have used Web Forms for 5 years and have been transitioning away from it to MVC whenever possible. It is a matter of preference but I like the control I have in MVC.

Link to comment
Share on other sites

  • 1 month later...

Due to the fact that both ASP.NET WebForms and ASP.NET MVC are two alternative frameworks (meaning that MVC is not mandatory and although came out later than WebForms does not actually replace it) of ASP.NET, they both share the .NET framework and the same essential runtime. Even though MVC adds on an additional runtime of sorts, to help with routing I believe...Anyway, it really comes down to personal preference.I'm starting new, currently, and am adopting MVC, but here are some very good pros and cons to both:WebForms:Pros- Allows rapid development of web applications- Doesn't require prior knowledge of HTMLCons- Rapid development leads to messy client ID outputs (or it can)- Masks the web (http's) true stateless environment- Although it can be tested, it does not provide intrinsic functionality like MVCMVC:Pros- Produces output with standards-compliant HTML- Separation of Concerns (everything has its own place like the Models, Views and Controllers that make up the "MVC" acronym) which leads to overall good development practices, extendability, maintainability and aids in projects where there is more than one person working on it. Say, the designer could be working on the views (the user-interface) while the developer or database-manager could be working with Models, etc, etc.- Easily testable with standard VS2010 (Visual Studio 2010) built-in and also support for many third-party testing platforms.Cons- Requires knowledge of HTML- Can be much slower to output a project than WebForms (due to its SoC nature)In the end, like I said before, this is really a personal question, however, in my opinion, it really depends on the project.Let's say you want to build a quick web application for a client, you may choose WebForms because you or your client or you and your client to particularly care about keeping HTML standards-compliant markup. However, if you would like to build a full-fledged ecommerce platform (although many use WebForms for this as well), you may choose MVC so that it could be maintained and extended so easily.Like I said previously, I'm just starting and although it's tempting to just use WebForms and piece together a web application real quick (because the drag and drop server controls really make this quite easy and fun! :) ), I really enjoy working with the MVC framework, just because it produces such clean code.Have fun and good luck!

Link to comment
Share on other sites

I've looked into both frameworks a little bit and I thought web forms was a terrible way to build web applications. It's full of page refreshes with postbacks on every user click. How do Web Forms not produce standards compliant HTML? I am pretty sure it would, although dragging and dropping components to produce HTML isn't the best way to develop markup.

Link to comment
Share on other sites

I've looked into both frameworks a little bit and I thought web forms was a terrible way to build web applications. It's full of page refreshes with postbacks on every user click. How do Web Forms not produce standards compliant HTML? I am pretty sure it would, although dragging and dropping components to produce HTML isn't the best way to develop markup.
Exactly, WebForms is tempting to many (including me) to use just because a relatively powerful web application can be produced quickly via the dragging and dropping of those server controls. It is definitely possible to develop a WebForms web application and still maintain a reasonably good handle of standards-based markup, however, almost always, an ASP.NET MVC web app will output far more standards-compliant markup than WebForms.And yes, I completely agree with page refreshes and postbacks on every user click. Like I mentioned in my previous post, WebForms attempts to veil the naturally stateless nature of the web environment, whereas MVC accepts that the internet is stateless, and therefore does not include postbacks with many page refreshes in its framework.And like I said before as well, they are both a great way (in my opinion of course) to develop dynamic web applications. I myself have been trying to get my head wrapper around the MVC architecture just because I think the Separation of Concerns is very valuable as far as maintainability and extendability. To give an example, think about if you wanted to develop an eCommerce site by scratch. Although easy to do in WebForms, with ASP.NET MVC, you could reuse that Model logic that you developed to build your eCommerce platform, for another new eCommerce website, while updating your Views to match the new look of the site. Additionally, when attempting to make a change to your entire web application's architecture, you will know where to look when you are hunting for that specific line of code, as opposed to WebForms, where it may be buried.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...