CodeGarden 2014

MVC Purée

1,568 views
June 26, 2014

Andy Butland / Zone

Given my background in the development of both Umbraco CMS and custom web applications using ASP.Net MVC, when MVC rendering support was featured in V4.10, it was the obvious way to go for future projects.

Working at gold partner Zone in London, we've built a number of sites using Umbraco and MVC. We've found that there's actually a number of different ways to do "MVC with Umbraco": the perhaps traditional Umbraco way with a fair bit of logic and data access in the templates or views, using surface controllers and child actions and/or using route hijacking. We've used a number of these approaches and found costs and benefits of each - which I think would make an interesting session.

Currently the model I use - and would focus on in the talk - is to go a more purist MVC approach, using dependency injection, thin controllers with route hijacking, mapping of Umbraco content to custom view models and use of strongly typed views. Tieing all this together is a mapping package (http://our.umbraco.org/projects/developer-tools/umbraco-mapper) that we've recently built, released and discussed on auHangout. We also look to use unit testing where possible.

In summary, the proposed discussion would be on ways to use MVC in Umbraco, and would cover:

  • quick primer on ASP.Net MVC and best practices in this area
  • approaches to MVC in Umbraco
  • surface controllers
  • route hijacking
  • custom view models and strongly typed views
  • mapping from Umbraco and other content to these view models
  • unit testing challenges and approaches
  • Q & A (no doubt there's as much to learn in this area as to impart!)

Rate this video

1 star 2 star 3 star 4 star 5 star
Add a comment...
Post as (log out)