InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Should ASP.NET Developers Learn ASP.NET MVC?

Posted by Jon Arild Tørresdal on May 01, 2009

Sections
Development,
Architecture & Design
Topics
Web Frameworks ,
Design Pattern ,
.NET Framework ,
.NET
Tags
ASP.NET MVC ,
Community

Many discussions of whether or not developers should use or learn ASP.NET MVC has been going on in blogs, Twitter and forums the last couple of weeks. The opinions varies from not recommended to all ASP.NET developers should learn it. InfoQ have tried to summarize some of the recent activity around this topic.

Rob Conerey (Microsoft employee at the ASP.NET MVC team and creator of SubSonic) explains why developers should learn ASP.NET MVC after observing questions raised in the community.

In his introduction he starts off by describing WebForms as “The Great Lie”:

WebForms is a lie. It’s abstraction wrapped in deception covered in lie sauce presented on a plate full of diversion and sleight of hand. Nothing you do with WebForms has anything to do with the web – you let it do the work for you.

This, friends, is a big deal (at least to me): You’re working in a lie. The web is *not* stateful and works with this stuff called HTML sent across wires using another thing called HTTP – you need to know this, love this, and feel it at the bone level.

Rob lists 7 reasons for using ASP.NET MVC or in his own words “7 Reasons To Stop Calling Me A Jerk”:

  1. Testability
  2. Control over HTML
  3. Extensibility
  4. It Makes You Think
  5. …Differently: Javascript Doesn’t Suck
  6. Learning New Concepts
  7. It’s Fun

And concludes with:

Bottom line: I’m having fun web programming again and I think that’s pretty motivating, at least for me and my cats. Yet Another Comparison, sure, but hopefully a bit more direct. You have absolutely no reason at all to not learn MVC – but I will concede there may be a reason or two for you to stick with WebForms.

Joe Brinkman (full time developer on DotNetNuke) quickly followed up with a response, criticizing Rob for not picking “A GOOD Reason To Learn MVC”, and lists his own:

  1. It will expose you to a different architecture
  2. You will be forced to become intimately familiar with HTML and HTTP
  3. MVC promotes unit testing
  4. MVC will make you see how much you take for granted with WebForms

Joe concludes by saying:

So in summary, you really should checkout MVC.  But not for the reasons Rob articulated.  You should explore MVC because in the end you might just learn something that will make you a better web programmer, no matter what platform you choose.

Both Rob and Joe is basically agreeing on the same, that ASP.NET developers should learn themselves ASP.NET MVC, but disagreeing on the why arguments. Karl Seguin however has a different opinion and ask “if ASP.NET is a half-baked solution”:

Being able to write complex systems more cleanly is a good start, but given where web development stands in general, and other platforms specifically, ASP.NET MVC lags far behind (Perl being the only one I can think of which is worse).

There's little question that a big part of the problem is that this is really a VC stack - there is no thought, no support, and no tools for the Model. When you compare the thousands of lines you'll end up writing for your repository/dal/linq/nhiberate to other MVC stacks (which commonly only require that your models to inherit from 1 class), you're already at a serious productivity disadvantage. But the true impact is actually much worse - you lose any cohesiveness of purpose through the controller and views. There is no way to generate HTML labels from model properties, or client side validation.

There is some good news, and that's that a lot of this "infrastructure" is reusable, which makes projects like S#arp Architecture possible. However, I'm still sceptical that these projects can truly succeed against better integrated frameworks.

 Jeremy D. Miller (one of the creators of FubuMVC) lists some pros and cons:

CON:
…the MVC framework is not efficient unless you're willing to roll up your sleeves and build your own project specific infrastructure to fill in the "M", achieve some better testability, easier screen synchronization, and more productive Html helpers…


PRO:
It's pretty easy and straightforward to take the MVC framework by the horns and customize it for your benefit.

Jeremy concludes by saying:

I stand behind the assertion that the ASP.Net MVC framework is a better way in the end to build web apps than an "abstraction wrapped in deception covered in lie sauce presented on a plate full of diversion and sleight of hand,"  but at this point it's probably a tool strictly for early adopter type folks.

Jeffrey Palermo (currently writing the book “ASP.NET MVC in action”) states that “You should NOT use ASP.NET MVC if…”:

  • You are not very comfortable with polymorphism
  • You aren’t willing to build on top of the framework
  • You rely on 3rd party vendor controls for lots of the UI
  • You are averse to using open-source libraries

But continues with:

The ASP.NET MVC Framework is an enabling framework.  It is not a “hold your hand” framework.  It is not a “ASP.NET 101” framework.  You have complete control over everything.  UI patterns in the web space are not so standardized that we can turn over control to frameworks that work in the “standard” way.  Data access has reached this point where we know we need Create, Read, Update, Delete, cascading persistence, lazy loading, etc.  There are many Object-Relational Mappers that support the common operations, and many developers are content giving up complete control over data access because of the similar way leading ORMs work (Hibernate/NHibernate).

There are of course many others that have expressed their opinions, but InfoQ find that the above summarize most of the arguments for and against learning/using ASP.NET MVC.

MVC and Windows by Alexander Johannesen Posted
Re: MVC and Windows by William Hegarty Posted
Re: MVC and Windows by Alexander Johannesen Posted
  1. Back to top

    MVC and Windows

    by Alexander Johannesen

    Uh, all this talk is a bit bizarre to me. Most good developers I know have played with MVC for, uh, at least 10 years? It shouldn't be a question of whether to use it or not, it should be closer to "what MVC or equivalent (like DCI) framework should I use for *this* problem." Color me baffled.

  2. Back to top

    Re: MVC and Windows

    by William Hegarty

    Uh, all this talk is a bit bizarre to me. Most good developers I know have played with MVC for, uh, at least 10 years? It shouldn't be a question of whether to use it or not, it should be closer to "what MVC or equivalent (like DCI) framework should I use for *this* problem." Color me baffled.

    Uhmm... I think you are missing the point that ASP.MVC is an actual MVC framework. (www.asp.net/mvc/)

  3. Back to top

    Re: MVC and Windows

    by Alexander Johannesen

    No, I don't think I missed that part. Just pointing out that MVC has been around for a *long* time, and it's a surprise to me to see it being hailed as something new in the Microsoft world. One of the things that "makes MVC possible" is the move from VisualBasic to C# (so they claim), or from a simplistic framework to a mature platform, which I find an amazing statement.

Educational Content

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.

Beauty Is in the Eye of the Beholder

Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.

Architecting Visa for Massive Scale and Continuous Innovation

John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.

Max Protect: Scalability and Caching at ESPN.com

Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.

The Seven Deadly Sins of Enterprise Agile Adoption

Are there repeated patterns of failure on Enterprise Agile Enablement efforts? Sanjiv and Arlen discuss Seven Deadly Sins to avoid when adopting Agile in an enterprise.

Questions for an Enterprise Architect

Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?

Wrap Your SQL Head Around Riak MapReduce

Sean Cribbs explains what Map-Reduce and Riak are, why and how to use Map-Reduce with Riak, and how to convert SQL queries into their Map-Reduce equivalents.