I’m big fan of ASP.NET MVC framework. It is smart, clean and testable. A lot of stuff you can do with MVC are very intuitive, you don’t have to go thought pages of documentation to do some basic stuff. I do not use MVC on my primary work yet (unfortunately) but my small project became very nice sandbox to play around and learn stuff.
I definitely learned something thought the year of hooked up with MVC. But feel I still miss a lot of details. Moreover, my hackers curiosity always force to look - “what is inside?”.
Great stuff about ASP.NET MVC project is that is open source. It is been released as open source and remain open source project till version 3.0.. In fact, it is very easy to start learning framework from inside! This what I’m going to do. I would like to go depth and hope that journey would be interesting and valuable.
Today I’ll to prepare everything I need for journey. I would be happy if you join me, so we would help each other along the way :).
That’s easy. Just google for “MVC3 source code” and it would bring you directly to ASP.NET Codeplex site.
mvc3-rtm-sources.zip. Unpack the archive and you will see the solution file
WebRuntime.sln and 2 folders:
webpages. Layout of both folders are similar:
/--- bin /--- src /--- tests /--- tools
Source code package is pretty much organized. Solution does not using NuGet, btw :)
It’s time open up solution! Fire up Visual Studio and open
WebRuntime.sln. Let the journey begins!
Nothing fancy there. Minimal number of solution folders, just
WebPages. Each of folder contains a bunch of projects in it. In nearest future we would be much interested in one
System.Web.Mvc - heart of MVC framework.
Don’t waste any time and just build the solution. As it usually happened to me, with OSS projects - you always have some issues during build. It is not the case for MVC. Build runs smoothly as possible. The output is being placed in
mvc3/bin/debug folder. So, as soon as build finished check it out and see for content.
All TDD lovers would be really pleased with a number of tests in solution. There is 5004 tests actually, solid number of tests. No surprise
MsTest framework is used. Let’s just try to run them!
In menu Test -> Run -> Tests in Current Context. Here we go.. It took a bit time to run all. I was a little disappointed to see that some tests are failing.
I did an inspection of failures and found out that all of them are actually related to my Local Settings. I use “Ukrainian Locale” that means time format, decimal point symbol etc. are differs from “United States Local”. It’s a quite common issue of units, workaround could be a simply change your locale to the one that rest development team uses. The rests of tests run’s just fine!
So, my initial impression are:
What I don’t like to far:
Next, I will setup a test project which allow us to fully get in deep of details and see how it work.
Please stay tuned.