altnetpedia

ASP.NET MVC Feeback

Modified: 2008/04/20 18:30 by RobinC - Uncategorized
ASP.NET MCV has been out for a while; some sites are already in production, although it is still in preview state.

Some people feel like it’s a step backwards because the view looks like classic ASP. The postback model is very powerful, but also very complex.

The thing that it does buy you is very good separation of concerns, and increased testability. Using webforms makes it very hard to write JavaScript against webforms apps.

It all comes down to how much friction you have with a given model. There is a place for each model. Keep in mind that MVC does not replace webforms, and there is no reason you should use MVC.

Often people that are using webforms successfully are not using the wizards and designers, and are using good design patterns.

The idea of the MVC allows you to be closer to the metal and have complete control over your html and requests/responses. In webforms, the abstractions often get in the way of certain things.

One example of the limitations of webforms is the back button won’t work on complex pages. In MVC, your URL will be unique for each page, and the back button will work as expected.

One thing that is lacking in MVC is rich controls. What is the best way to handle these scenarios? One idea is to have sub controllers that allow a very specific functionality encapsulated in a reusable way.

There will be more client side controls and Ajax controls since there is no postback. If you did have a control that did posts for you, how would you handle the rest of your state?

Web development is very hard, and webforms made it easier. Now that we have come up with more advanced ways to do web development, it might make more sense to move to a model that is more aligned with the architecture of the web. Also browsers have gotten much better, which gives more JavaScript and CSS support.

One idea about MVC in general is why do we have controllers at all, instead just make actions a first class citizen, and make the routing work against them directly. We have the controllers for organizations, in some scenarios, using controllers allows for using inheritance to hide complexity.

How do we sell the idea of MVC to clients / businesses? Testability is great, but most clients don’t want to pay for that. One good selling point is SEO that you can easily do with MVC. Also, testability gives you agility and allows you to add features faster and with more confidence.

Selling MVC to a development team is different matter. If a team is interested in testability, then it should not be too hard. On the other hand, if your team is very good with webforms, and used to that model, it might not make sense.

Another question is how MS is helping sell MVC. They have said it may only apply to 5% of customers, which may lead customers to think it is not a first class effort from MS. Will MVC be a long term strategy for MS? It looks that way right now, but will that continue to be the case if it’s not successful in the marketplace.

One of the reasons MS has said that MVC only applies to 5% of customers because they don’t want to scare people who are comfortable with webforms and don’t want to have to rewrite their sites on MVC. The audience for MVC and testable design patterns is growing, so it seems unlikely that MS will drop MVC.

A large part of the .NET customer base isn’t interested in TDD and testable design, and MS does not want to abandon them. Going forward, MS wants to support both of these audiences.

Even though MVC seems to have a huge following, and there is not a vocal group that wants to use webforms, what we are hearing is the alpha developers speaking up. There are plenty of 9 – 5 developers who are not involved in the community that are not interested in MVC.

What are some of the benefits of MVC besides testability? Having a front controller allows you to focus on the business value and not jumping through the hoops of the leaky abstractions in webforms. Also it supports a more natural and domain driven way of working.

What things would you like to see in ASP.NET MVC? Some people want to have the concept of areas (which are from Monorail), but with the routing features, it is not really necessary. Another thing would be a better extensibility. Since we can’t contribute patches to MVC, it would be great to have a good plug-in model.

One thing that the team is working on is sub controllers, which do help extensibility. Also, there might be a separate set of declarative controls for ASP.NET MVC, which would allow for an additional extension point.

Also testing MVC is still not quite there. It is hard to mock out the RenderView method. The newest refresh of the MVC preview no longer calls render view, instead the Execute method calls it. This allows for your controllers to be tested without mocking out the call to RenderView.

How should sub controllers work? It could become complex to have multiple different levels of views and controllers. It would be good to be able to package up a view and its behavior.

What about providing hosting infrastructure? Could ASP.NET MVC be part of an answer to Google App Engine? MS is looking at the possibilities, but has no public plans right now. They have a prototype of asynchronous actions, which would play heavily into that kind of offering.

What would the point of MS getting into that business? There are lots of ASP.NET hosting companies, what would be better or different about a MS based solution.

ScrewTurn Wiki version 2.0.36. Some of the icons created by FamFamFam.