Feb 12

A Web Recipe: Thoughts on making this better

This is the final post in the series described here.

I thought I’d wrap up by touching on a few thoughts to improve the solution and take it further, some of which I did implement in the code.

Simple Usability Enhancements

As it stands, users have to enter a date in a proper format. Why not just let them choose. So I added a simple update to use the jquery UI date picker on the review dialog.  Also, the grid default sort was never set.  Using the aaSorting initialization parameter, you can specify which column should have the default sort in a grid.  I added this to both grid instances.


None of what I built had much style.  It really doesn’t look like it is part of a site for that matter as it was simply a POC without any real use cases.  The patterns have sort of an Admin feel which might not map to a great consumer Beer application.  That aside, here is where the MVC approach is nice.  Without touching server code, we (or better yet a designer) can improve the markup, add some CSS classes and define some style rules and quickly have us looking much better. 

Data Access Layer

I referred to use of my datacontext as a data access layer.  There is certainly a lot of room for opinion on approaches for better abstracting that away.  One approach would be to take all the domain classes like Beer and Brewery and move them to a Clarity.BeerApp.Data.Model assembly, leaving the context in the Data assembly.  My entities really don’t need to know anything about EF and can be separated.  Then I can build mock contexts and support better testing.  I may do this in the future and post an update.

Routing Improvments

Similar to the DataTables parameter binding improvements I suggested in the posts, there may be other ways to take better advantage of MVC features.  I didn’t explore this, but there may be some benefit to registering routes with the app to better handle some of the Review edits which would simplify the url creation.  Or maybe the Review views should have their own controller.  That is all open for debate.

In summary, this sample and set of posts was a starting point for me to look into combining Entity Framework 4.2, ASP.NET MVC 3 and the jquery DataTables into a web app.  I built off of some other’s ideas referenced in the initial post and hope this might help as a reference for some else learning about these technologies.

38 comments , permalink

Tagged , , , , , ,