If you’re anything like me, you probably learn a lot better by going through code rather than reading books. I’m happy to release the Foundations of Programming Learning Application – it’s a complete solution meant to show what was covered in the Foundations series. It’s a Visual Studio 2008 solution.
You can download it here. It should require no configuration (my fingers are crossed on that one) and ought to just run out of the box. There are comments sprinkled all over to help explain things or provide some insight. No doubt there’ll be typos, since I’m nothing without word.
(you can grab the free ebook from: http://codebetter.com/blogs/karlseguin/archive/2008/06/24/foundations-of-programming-ebook.aspx)
What is it?
It’s a sample awards website – with categories and nominees. The root container is called a Round – a sample Round would be called ‘The 2008 CodeBetter Awards’. A Round has a state (planning, annoucements, voting, winners) and a number of Categories (Best Blogger, Best Blog Post, Best Open Source Project, …) with each categories having a Nominee (Title, Summary, Link, Author…). The website is using the ASP.NET MVC Preview 4 – I don’t think you’ll need to install anything extra as all the DLLs are included with the project. I’m using an SQL Lite database with a relative path to the file, so all should work as-is. Dummy data is already loaded.
The web application mostly shows a read-only view of the data. There’s also a sample console application that does more administrative stuff (it isn’t interactive, it just runs through 4 steps or so). You can run the administrative portion over and over again – the first step is to clean itself up. The admin part basically adds a new round, with categories and nominees.
Of course, there’s a project full of unit tests as well.
I tried to keep everything simple and straightforward (which is largely why I didn’t want to build a whole web-based admin module and user registration and all that). Like most, I’m pretty new to ASP.NET MVC. Some might think my views have too much code, I think they have the perfect amount [:P]. There’s extensive use of Lambdas, so if you have a hard time reading them, I hope my excessive examples will help illuminate them.