Comments on: Should You Use ASP.NET MVC? http://www.kevinwilliampang.com/2009/04/21/should-you-use-asp-net-mvc/ ASP.NET Developer. ALT.NET Supporter. Pragmatic Programmer. Published Writer. Wed, 01 Dec 2010 20:34:08 +0000 hourly 1 By: foobar http://www.kevinwilliampang.com/2009/04/21/should-you-use-asp-net-mvc/#comment-689 foobar Sat, 25 Apr 2009 04:58:33 +0000 /post/Should-You-Use-ASPNET-MVC.aspx#comment-689 -- Chris "Here's Microsoft's new MVC starter kit" Hmm, the link doesn't work for me. – Chris
"Here’s Microsoft’s new MVC starter kit"

Hmm, the link doesn’t work for me.

]]>
By: Chris http://www.kevinwilliampang.com/2009/04/21/should-you-use-asp-net-mvc/#comment-688 Chris Thu, 23 Apr 2009 14:43:27 +0000 /post/Should-You-Use-ASPNET-MVC.aspx#comment-688 My co-workers talk about how great it is all the time. Here's Microsoft's new MVC starter kit: http://msdn.microsoft.com/en-us/architecture/bb194897.aspx. It's a presentation-community-like app, and it's so decked out! My co-workers talk about how great it is all the time. Here’s Microsoft’s new MVC starter kit: http://msdn.microsoft.com/en-us/architecture/bb194897.aspx. It’s a presentation-community-like app, and it’s so decked out!

]]>
By: pete http://www.kevinwilliampang.com/2009/04/21/should-you-use-asp-net-mvc/#comment-687 pete Thu, 23 Apr 2009 06:34:50 +0000 /post/Should-You-Use-ASPNET-MVC.aspx#comment-687 @John Farrell, @Phil Betjeman When I first saw MVC there were two negatives. One was the ugly classic ASP if statements. The Second was no controls which I thought ment no generic Grids. With new technology comes new ways of thinking. What ever control you lost look to JQuery plugins to replace it. DataTable, jqGrid plugins are replacements for the grid control. jVal and Validate are plugins that replace the Microsoft validation. As far as old classic ASP look I have found ways to maintain a clean look. DropDowns require a for-each loop to spell out all the options. This can add alot of code to page. So refactor and put dropdown code into a partical. Then on the main page do a RenderPartical. @John Farrell, @Phil Betjeman

When I first saw MVC there were two negatives. One was the ugly classic ASP if statements. The Second was no controls which I thought ment no generic Grids.

With new technology comes new ways of thinking. What ever control you lost look to JQuery plugins to replace it. DataTable, jqGrid plugins are replacements for the grid control. jVal and Validate are plugins that replace the Microsoft validation.

As far as old classic ASP look I have found ways to maintain a clean look. DropDowns require a for-each loop to spell out all the options. This can add alot of code to page. So refactor and put dropdown code into a partical. Then on the main page do a RenderPartical.

]]>
By: Phil Betjeman http://www.kevinwilliampang.com/2009/04/21/should-you-use-asp-net-mvc/#comment-686 Phil Betjeman Thu, 23 Apr 2009 03:41:06 +0000 /post/Should-You-Use-ASPNET-MVC.aspx#comment-686 [i]There aren't any repeaters or datagrids that magically generate markup for you. [/i] I know what you mean (we do not employ people who show a tendency towards auto-generated HTML), but repeaters and placeholders are the only ASP.NET controls I use as they are the only ones that don't "magically generate markup". Repeaters give you complete control over what HTML is output (Datagrids and Datalists are horrible though). [i]There aren’t any repeaters or datagrids that magically generate markup for you. [/i]

I know what you mean (we do not employ people who show a tendency towards auto-generated HTML), but repeaters and placeholders are the only ASP.NET controls I use as they are the only ones that don’t "magically generate markup". Repeaters give you complete control over what HTML is output (Datagrids and Datalists are horrible though).

]]>
By: Mike Johnson http://www.kevinwilliampang.com/2009/04/21/should-you-use-asp-net-mvc/#comment-685 Mike Johnson Wed, 22 Apr 2009 16:45:32 +0000 /post/Should-You-Use-ASPNET-MVC.aspx#comment-685 @crag To test the UI we have been using ACT to record and execute scripts for years and unit tests for things CRUD logic that was incorporated into the page. Is it perfect? Definitely not. The UI scripts are not as sensitive as scripted testing in the desktop days with VT but you still get days of "fail 500". I asked my question because TDD is almost always held up as the #1 gain in coding for asp.net MVC and I wanted to know what is gained because I sensed there is a gap between what I perceived to be web testing and what everyone was so excited about. @crag

To test the UI we have been using ACT to record and execute scripts for years and unit tests for things CRUD logic that was incorporated into the page. Is it perfect? Definitely not. The UI scripts are not as sensitive as scripted testing in the desktop days with VT but you still get days of "fail 500".

I asked my question because TDD is almost always held up as the #1 gain in coding for asp.net MVC and I wanted to know what is gained because I sensed there is a gap between what I perceived to be web testing and what everyone was so excited about.

]]>
By: Mike Johnson http://www.kevinwilliampang.com/2009/04/21/should-you-use-asp-net-mvc/#comment-684 Mike Johnson Wed, 22 Apr 2009 16:43:14 +0000 /post/Should-You-Use-ASPNET-MVC.aspx#comment-684 @kevin thanks for the explanation. I can definitely see benefits of being able to test more in the base tool (vs 2008) compared to what we have done at the shop I work for in winforms and webforms. @kevin

thanks for the explanation. I can definitely see benefits of being able to test more in the base tool (vs 2008) compared to what we have done at the shop I work for in winforms and webforms.

]]>
By: Craig http://www.kevinwilliampang.com/2009/04/21/should-you-use-asp-net-mvc/#comment-683 Craig Wed, 22 Apr 2009 15:23:16 +0000 /post/Should-You-Use-ASPNET-MVC.aspx#comment-683 Mike, how do you unit test your event handlers in WebForms? Mike, how do you unit test your event handlers in WebForms?

]]>
By: Kevin Pang http://www.kevinwilliampang.com/2009/04/21/should-you-use-asp-net-mvc/#comment-682 Kevin Pang Wed, 22 Apr 2009 15:20:59 +0000 /post/Should-You-Use-ASPNET-MVC.aspx#comment-682 @mike johnson With ASP.NET MVC, you gain the ability to test your controller actions, which are analogous to the server side events in ASP.NET web forms. For example, a unit tests that you can do easily on ASP.NET MVC but not in ASP.NET web forms is testing whether or not a user is redirected to the correct page when they click on a link. This will let you test, among other things, if your security settings and permissions are working as expected. You can also test out behavior this way (i.e. when this action is performed, are the following functions called and is the response to the user what you expect). You aren't necessarily testing the html response so much as the system's response to requests to the controller. @mike johnson

With ASP.NET MVC, you gain the ability to test your controller actions, which are analogous to the server side events in ASP.NET web forms. For example, a unit tests that you can do easily on ASP.NET MVC but not in ASP.NET web forms is testing whether or not a user is redirected to the correct page when they click on a link. This will let you test, among other things, if your security settings and permissions are working as expected.

You can also test out behavior this way (i.e. when this action is performed, are the following functions called and is the response to the user what you expect).

You aren’t necessarily testing the html response so much as the system’s response to requests to the controller.

]]>
By: mike johnson http://www.kevinwilliampang.com/2009/04/21/should-you-use-asp-net-mvc/#comment-681 mike johnson Wed, 22 Apr 2009 15:04:16 +0000 /post/Should-You-Use-ASPNET-MVC.aspx#comment-681 Could someone explain what exactly you are able to test that you couldnt test in webforms? I mean most of the business logic, data access are factored out of webforms and can and should be tested outside of a web context. Are you testing the html response based on a simulated request to the controller? This sounds more like the ability to write acceptance level tests than unit tests. Please be gentle and fill in the gap in my understanding of MVC. Could someone explain what exactly you are able to test that you couldnt test in webforms? I mean most of the business logic, data access are factored out of webforms and can and should be tested outside of a web context.

Are you testing the html response based on a simulated request to the controller? This sounds more like the ability to write acceptance level tests than unit tests. Please be gentle and fill in the gap in my understanding of MVC.

]]>
By: Matt Briggs http://www.kevinwilliampang.com/2009/04/21/should-you-use-asp-net-mvc/#comment-680 Matt Briggs Wed, 22 Apr 2009 15:01:05 +0000 /post/Should-You-Use-ASPNET-MVC.aspx#comment-680 I disagree with this whole "...its good if you want control of the markup" argument. WebForms was designed so that you could develop web applications and not understand how web programming works. It did a decent job in some areas, and a terrible one in others. As long as you actually do understand how the web works, and learn the rediculesly complex way that webforms works, you can usually work around the profoundly bad ideas yourself (ViewState, ASP.NET AJAX, the raping of element IDs, Extenders). The problem with WebForms is while they will take you 80% of the way extraordinarily fast, that last 20% will take about ten times as long as it should. The MVC model is the direction everyone else outside of microsoft moved to years ago. It fits the web a lot better, reduces the complexity and overhead of ASP.net, and using it will not get you painted into a corner of pain the same way that webforms almost inevitably does. The one and only downside over webformss is you can't do anything without actually understanding and learning the technologies that power the web. I disagree with this whole "…its good if you want control of the markup" argument.

WebForms was designed so that you could develop web applications and not understand how web programming works. It did a decent job in some areas, and a terrible one in others. As long as you actually do understand how the web works, and learn the rediculesly complex way that webforms works, you can usually work around the profoundly bad ideas yourself (ViewState, ASP.NET AJAX, the raping of element IDs, Extenders). The problem with WebForms is while they will take you 80% of the way extraordinarily fast, that last 20% will take about ten times as long as it should.

The MVC model is the direction everyone else outside of microsoft moved to years ago. It fits the web a lot better, reduces the complexity and overhead of ASP.net, and using it will not get you painted into a corner of pain the same way that webforms almost inevitably does. The one and only downside over webformss is you can’t do anything without actually understanding and learning the technologies that power the web.

]]>