Derik Whittaker

Syndication

News


Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
My wish list for the ASP.Net MVC Framework going forward.

I have been using the MVC framework now for 3+ months.  In fact I already have a public production site running on the framework (www.dimecasts.net).  I have to say that I am really, really happy with the progress and direction that the team is making. 

But I do have a few things I would like to throw out there as my 'Wish List'

  1. Do not seal any classes's.  There is no need to seal anything.  Once you seal stuff you are saying that no-one will EVERY want to make use of this class in a slightly different way.

    Examples: AuthorizeAttribute & HandleErrorAttribute.

    *** NOTE ***
    I have already been told per Scott Gu that this is going to happen in future releases, but just putting my wish out there.
    *** NOTE ***
  2. Try to make as much stuff as possible virtual (overrideable for you VB'ers out there).  This will allow us to extend our applications to better meet our needs.
  3. Make use of more Interfaces.  Since testing is really high on the list of priorities for the MVC using more interfaces for classes would simplify mocking and testing.

    Example: Anytime a ControllerContext is used (attributes) it is extremely painful to mock these things our for testing.
  4. Do not become afraid to implement breaking changes
  5. Keep up the good work.  I am really enjoying using this framework as I feel it makes my development experience much better.

So there you go, my simple little wish list for the team.  I know it is nothing earth shattering, but I just wanted to get that out there.

Till next time,

[----- Remember to check out DimeCasts.Net -----]


Posted 08-05-2008 5:52 AM by Derik Whittaker
Filed under:

[Advertisement]

Comments

ASP.NET MVC Archived Blog Posts, Page 1 wrote ASP.NET MVC Archived Blog Posts, Page 1
on 08-05-2008 8:59 AM

Pingback from  ASP.NET MVC Archived Blog Posts, Page 1

Dew Drop - August 5, 2008 | Alvin Ashcraft's Morning Dew wrote Dew Drop - August 5, 2008 | Alvin Ashcraft's Morning Dew
on 08-05-2008 9:08 AM

Pingback from  Dew Drop - August 5, 2008 | Alvin Ashcraft's Morning Dew

me wrote re: My wish list for the ASP.Net MVC Framework going forward.
on 08-05-2008 11:36 AM

Please change "no one will EVERY" to "no one will EVER" ... thanks.

me wrote re: My wish list for the ASP.Net MVC Framework going forward.
on 08-05-2008 11:37 AM

Please make a Dimecast about the power of Interface-based programming.  I'm trying to grok it.

Bill Sorensen wrote re: My wish list for the ASP.Net MVC Framework going forward.
on 08-05-2008 1:42 PM

The attributes are likely sealed due to the FxCop performance rule: Avoid unsealed attributes.

Brian wrote re: My wish list for the ASP.Net MVC Framework going forward.
on 08-05-2008 9:43 PM

I'd be weary about striving for everything to be interface based.

Putting interfaces in just for the sake of testing frameworks is adding extra moving parts and incurring extra maintenance costs. Because now each time you want to add on to something you have to add on to the interface and any classes that implement; plus your making a more complex system for the next guy to figure out/maintain/extend.  Fowler says something about that in an article.

That's almost as bad as having less/no security so you can test your application, or incorrectly scoping your properties or methods for a testing framework.  You're building the application for the customer, not the NUnit/NMock.  And to be fair, there is a trade off there, but there's also a point of diminishing returns.

To me it's the equivelant of saying (in 1998); no current video cards can support the type of vector graphic we'd need for this video game...we'd need at least 128MB of memory for that.  So let's just make all the game manufacturers out there use the current version of direct x, dumb down our game, and not let's try to solve the real problem, or put pressure on the manufacturers out there solve the core problem.

Feeding to the 'build more interfaces so I can test' is dangerous to our industry.  Myself and others have been testing for years without that, and while painful sometimes, I haven't traded security/maintenance/complexity for it and I rather have the occasional painful moment than add extra moving parts for a test framework.  You build your test once - you maintain and extend your application for years.  

Use interfaces where they're needed - where the interacting object is unknown and virtually anything that matches a certain signature.

Maybe as a community we should try to solve the problems we have with testing frameworks that cause us to have to hack our applications with unneeded interfaces, making methods public that should be private, reducing security, and in general just introducing more moving parts into our system.

Just food for thought.

Christopher Steen wrote Link Listing - August 5, 2008
on 08-05-2008 11:26 PM

Link Listing - August 5, 2008

Link Post For August 7 2008 | One .Net Way wrote Link Post For August 7 2008 | One .Net Way
on 08-06-2008 8:38 PM

Pingback from  Link Post For August 7 2008 | One .Net Way

Derik Whittaker wrote re: My wish list for the ASP.Net MVC Framework going forward.
on 08-07-2008 6:18 AM

@Brian

I am in no way saying that I want interfaces on everything.  What I am saying is i would like them in places where it makes sense (to me).

For example.  When you base a class off of the FilterAttribute it exposes a method 'OnAuthorization'.  This method has a single parameter AutherizationContext.   When I was writing my code in this method I would have liked to be able to better/easier test this, but was not able to because a concrete class was used and mocking that was very, very painful (lots of moving parts have to be mocked).

Had it implemented an interfaces say 'IAutherizationContext' I could have very easily mocked this and written my tests.

This is what I am referring to by wanting interfaces used more.

Recent Links Tagged With "mvc" - JabberTags wrote Recent Links Tagged With "mvc" - JabberTags
on 10-19-2008 4:04 PM

Pingback from  Recent Links Tagged With "mvc" - JabberTags

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)