Whilst I do my best to keep up with new programming concepts and techniques the reality is that there is always something new to learn and not enough hours in the day so I am committed to trying to learn at least one new thing a week.
One area I have been wanting to learn more about is ASP.NET MVC which was Microsoft's response to the success of Ruby on Rails. Like Ruby on Rails it is built on the (fairly old) concept of a Model-View-Controller architecture which is a better fit to the Web's natural statelessness than the forced state of standard Web Forms.
I have done plenty of reading on the subject and completed a few small tutorials in the past but never had the time to get to in depth so this week I have been delving deeper into the technology and trying to build a boilerplate solution which I can roll out across projects - you can see the results over on github - this is by no means complete and still has a number of issues but it does include some important elements -
One area I have been wanting to learn more about is ASP.NET MVC which was Microsoft's response to the success of Ruby on Rails. Like Ruby on Rails it is built on the (fairly old) concept of a Model-View-Controller architecture which is a better fit to the Web's natural statelessness than the forced state of standard Web Forms.
I have done plenty of reading on the subject and completed a few small tutorials in the past but never had the time to get to in depth so this week I have been delving deeper into the technology and trying to build a boilerplate solution which I can roll out across projects - you can see the results over on github - this is by no means complete and still has a number of issues but it does include some important elements -
- Uses ASP.NET MVC 3 with the new Razor view engine and a HTML5 boilerplate template
- Error Logging via ELMAH - if you haven't heard of this before it is really worth checking out, I will probably do a blog post on it in the future.
- LLBLGen Pro 3.1 for O/RM Mapping with some custom template modifications for generating entity interfaces in order to help implement the repository pattern.
- Inversion of Control and Dependency Injection is handled by Castle Windsor and is so easy to set up but has so many benefits.
- Built using TDD concepts using NUnit
One of the hardest things I have found is trying to work out exactly what belongs in which layer, as an example - my initial design required the controller to know about the LLBL entities which created a dependency between the UI and the Data Access Layer which was obviously a bad design so I had to fix that (via the custom LLBL templates).
I will continue to expand the project and hopefully write a follow up post in a few weeks.
Any comments/improvements would be gratefully accepted :)