Posted by: Alexander Koval on 6/14/2010

MVC with Windows Azure

     Recently my research concentrated on implementing MVC 2 with the Windows Azure and I would like to share the tips and tricks I have learned. I assume that the reader is familiar with Windows Azure and MVC. The sample code from this article use Windows Azure SDK as well as Web Platform Installer (installs MVC 2).

        Firstly, there is a little twist in how to create MVC 2 projects in Windows Azure in VS 2008. The problem is that VS2008 templates do not have MVC Web Role for Windows Azure. You can read here the great explanation by Jim Nakashima how to create an MVC Project running on Windows Azure.

MVC Structure

 

Benefits of MVC framework for Windows Azure

1. Better SoC.

     MVC allows to achieve better Separation of Concerns as all your business logic is placed into the Controller, all your Data Access Code is placed into the Model, and all your UI code is placed into the View.

2. Follows natural application cycle

     MVC facilitates the natural application cycle as the User actions are forwarded to the Controller and become the Controller's methods. And vice versa, the result of the Controller's methods is forwarded to the View. 

3. Better testability through Unit-Testing

     Since the entire Business Logic is placed into the Controller class, it becomes easier to unit-test the class. The Model is usually faked, and the action results are verified agains the expected results.

4. Extensibility

     MVC allows for extensibility. You may subclass and develop your own plumbing for the Routing Engine, Controller classes, Views, etc.

 5. Powerful Routing System

     One of my favorite features of MVC is the Routing engine. The routing engine is search engine-friendly as it provides for human-readable urls.

     

 

I demonstrate all the benefits of the MVC with Windows Azure in two demos.

Demo 1 - Twitter application (MVC2, Azure, Twitter API, Unit-Test)

Demo 2 - Azure application (MVC2, Azure, Table Storage, Unit-Test)

     


Add your comment here