views:

432

answers:

4

I'm a big fan of what ASP.NET MVC is doing, on many levels.

I'm about to take part in re-build of a very highly trafficked website, and I'm not which framework would be best (if any).

The site will need the following:

  • To support Javascript-heavy, highly interactive pages
  • But at the same time, provide underlying semantic HTML for search engines
  • Support multiple languages
  • Be skinnable
  • Expose a RESTful web-service API for partners

As far as I can tell, there's no reason not to use ASP.NET MVC for this.

  • I can present semantic HTML and layer Javascript on top using jQuery.
  • Multiple languages can be catered for using Resource files (same as at present).
  • Skinning can be done with CSS (it won't involve changes to the markup).
  • I can centralize business logic so that the Controllers and the WCF web-service use the same code.

But are there potential drawbacks to using MVC that I haven't considered?

I don't want to be the guy who picks a technology because it's cool but finds later down the track that it isn't very suitable for the job.

+6  A: 

ASP.NET MVC is not good when all your doing is making a website that needs server-side code (but that's also true about ASP.NET also).

In your case I think MVC would be a great way to go. MVC has proven itself on high traffic websites (e.g. this one). However you must remember that MVC is new and changing. A library may not exists to do a specific task which means you'll have to write that code yourself.

Good luck on your rebuild!

Lucas McCoy
+5  A: 

You're good to go with MVC given what you've said about your project.

As far as I'm concerned, ASP.NET MVC is really only NOT good for situations where you have a large codebase in WebForms (meaning you have a lot of ASP.NET user controls, custom controls, etc). It's also not good if you are going to have people working on it who don't know what it's all about. Other than that, it's a pretty nice technology.

Dave Markle
+5  A: 

I do not like ASP.NET MVC because of following reasons:

1. Ugly routing API, there http://ayende.com/Blog/archive/2008/11/05/a-case-study-of-bad-api-design-asp.net-mvc-routing.aspx is description of what is wrong. By the way, friendly urls can be easily implemented without mvc http://demo.liveui.net/bugtracker/Tasks/7

2. Poor object model. It is proved that good software should consist of reusable components. There is nothing that can be reused in ASP.NET MVC based web site. For example, if you implemented smart drop down list once it will be difficult to use it again (even on the same web site).

3. Lack of controls. Some features (like TreeView or Menu) are already implemented as Controls and it would be waste of time to reimplement them using mvc.

If I were you I would try to find some CMS and customize it for WebSite needs.

To responses: YES. I know about ASP.NET controls disadvantages, but the question is about ASP.NET MVC. One can write a book about what is good and what is bad in ASP.NET but I do not think it is appropriate to discuss it here.

Alex Ilyin
I would downvote this if it were community wiki like this question and it's answers should be. You didn't really address his points. Controls tend to have bad markup. You can easily do reusable components (try using Spark instead of Webforms view engine). You may have a point on the routing API. It may be ugly, but it does work sufficiently well.
John Sheehan
I do agree with his point that the routing engine could be improved.About re-usability, it's true that you can't use classic ASP.NET controls, however you *can* use jQuery/javascript components much more easily in ASP.NET MVC, while maintaining clean, semantic markup.
jonathanconway
I do not see reasons why controls should have bad markup. Even MVC like syntax can be used in any ASCX control. About poor object model. It is proved to be useful to have object model which can be modified or customized after creation. For example, having control based object model I can modify controls' properties listen events and so on... Whereas with MVC ideology it is difficult to change something once view was created.
Alex Ilyin
By the way, JQuery is nice. But design of most JQuery based components is bad for the same reason. There is poor object model. It is usually difficult to override or customize something. ExtJs in contrast has excelent design and flexible object model.
Alex Ilyin
Thought you could create HTML Helper methods to implement things like smart drop downs and re-use it throughout your site fairly easily...
davewasthere
You can reuse components of MVC, one of the points is a separation of concerns. As such you can change pretty much anything and swap it in and out of other projects, such as a custom view engine. It's trivial to reuse components (i.e smart drop down) btw. In MVC 2.0 they will have templated controls to address some of these issues byt mostly it's fine.
Damien
+3  A: 

My two cents:

ASP.NET MVC is a great option but there is a little learning curve involved, so make sure your project plan/timeline has this handled. There might be developers on your team who might not be comfortable working with ASP.NET MVC, and this can cause possible delays (a lot of developers are still working in ASP.NET 1.1!).

@Alex: Lack of controls. Some features (like TreeView or Menu) are already implemented as Controls and it would be waste of time to reimplement them using mvc.

IMO the idea of using controls in ASP.NET MVC doesnt make much sense. You can create a treeview control using jQuery easily. Classic ASP.NET server controls carried a lot of baggage (viewstate etc) and hence ASP.NET MVC did not use any of those controls (though you can use helpers).

Finally, ASP.NET MVC is an alternative, not a replacement to Web Forms. I would not use ASP.NET MVC as it is still evolving, and my team is not very comfortable with it, but I guess slowly more and more programmers would shift to this (better) option.

Vivek