Accommodate Project Complete

Well, I have completed the Accommodate project for the Ronald McDonald house of Iowa. The site is online and and useful. Let's discuss the architecture just a little.

First, we used SQLite as a database. This is a small, embedded database that is pretty fast and free. See for details.

Next, I used the Microsoft Entity Framework (EF) to create a data access layer over the SQLite database tables. EF made it simple to get at my data and represent it in an object format. If you aren't using a solid Object Relational Mapping system then I suggest you take a look at EF. It worked well for me and Microsoft isn't charging anything for you to use it.

What made EF work well for me is the support for Language INtegratated Query (LINQ). LINQ lets you create strongly typed query statements as C# expressions. So, you get all the Intellisence goodness while creating or queries. It also meant that I didn't need many of the advanced features of the larger database systems since I could express my logic directly in the C# code. I didn't need Stored Procedures, Triggers, User Functions or the like. I just did all that kind of work directly in my C# code.

The next layer of Accommodate is an ASP.Net MVC application. The MVC framework allowed me to quickly scaffold out the basic Create Read Update Delete (CRUD) operations over my EF objects using a controller for each table. Since much of the CRUD operation code is the same across tables, I was able to make a base class for my controllers and move many of the operations and helper methods into that base class and keep my code DRY (Don't Repeat Yourself).

I found it to be really simple to create the CRUD operations because of the parameter mapping that MVC does for you. When you do a form post to an MVC operation, the framework looks at the incoming fields in the form post and automagically maps them to the parameters in the function and even casts them to the correct data type! This means I can do something like this:

        [Authorize(Roles = "Administrators,Purge,Update")]
        public ActionResult Update(long id, long roomNumber, 
            bool IsInOrder, string Description, string Comment, 
            DateTime DateAdded, DateTime? DateRemoved)

When a form post is pushed to this method, MVC automatically fills out all the parameters from the incoming post. Note that I can also declare an attribute to specify what user roles are allowed to call this method - super easy security!

The last tier is the end user's web browser. Yes, I consider this a tier because I put a lot of functionality in this tier using jQuery. jQuery and jQueryUI have some pretty awesome functionality to make browser scripting actually useful. I added in some grid controls and some client side validation scripts to make the site much more useable. If you are a web developer then you need to get familiar with jQuery.