Dataworks Blog


  • Why MVC ?

    In the late nineties developers on a Microsoft stack would have been using Active Server Pages (ASP) for server side scripting and would have had to have a reasonable understanding of web development i.e. the stateless nature of the web and use of the HTTP protocol in general.  At that time, Microsoft had a large network of Visual Basic developers developing windows based software., first released in 2002, provided a path for these developers to get into the rapidly growing space of web development with a reduced learning curve.  

    This reduced learning curve was achieved by abstracting the stateless nature of the web using mechanisms such as viewstate and postback. allowed controls to be dragged to the page, code behind allowed events to be added to these controls, encouraging an event driven GUI approach to web development.  This provided a development environment familiar to those migrating from Windows desktop development but had some drawbacks.  This level of abstraction meant that developers where removed from the stateless nature of the web.  Code behind classes, introduced to reduce the amount of code mixed in with HTML on the web pages, often became tangled, with business logic being mixed in with UI related code.  

    In parallel to moving through several versions, web development outside the Microsoft stack was going through some major changes.  Some major leaps forward came with the adoption of Javascript libraries on the client and MVC frameworks on the server side. Client side Javascript libraries such as Jquery, Prototype etc. greatly simplified client side scripting.  Server side frameworks such as Ruby on Rails allowed for quicker development of web based applications while being true to the stateless nature of the web.  These advances encouraged the use of RESTfull URLs and facilitated Test Driven Development (TDD).  TDD was becoming increasingly important to web application development, particularly where Agile methodologies were being adopted.

    With the release of MVC Microsoft embraced these advances in web development and offered developers on the Microsoft stack an alternative to web forms. MVC now on version 3 with version 4 in beta offers the following advantages. 


    Separation of concerns

    Core to the MVC framework is the design pattern behind the acronym in its name, Model, View Controller.  Separation of concerns is fundamental to this pattern, which can be summarised as follows

    Model: The model contains the business logic of an application, retrieves data and enforces validation rules

    View: The view contains the user interface of an application

    Controller: The controller classes manage the control flow.  These interact with the model and return appropriate views.

    Software always changes. The separation of concerns provided by this pattern allows for greater flexibility, thus making change less painful. For example, a view can be changed independently of the controller and models.  This also allows different developers to work on different parts of the application in parallel.


    HTML and Javascript provided a drag and drop event driven GUI builder postback and viewstate, which aided Rapid Application Development (RAD), had a cost in terms of control over the HTML mark-up. MVC allows full control over your HTML mark-up.  This allows for the adoption of HTML5, cleaner CSS and enables integration with Javascript libraries such as JQuery, all essential for modern Rich Internet Application (RIA) development.


    URLs MVC encourages the use of RESTfull URLs.  These URLs are human readable, SEO-friendly and discoverable, for example






    One of the main advantages of SOC mentioned earlier is that it facilitates Test Driven Development (TDD).  With the adoption of Agile methodologies TDD has become an essential part of web development.  Tightly coupled code is difficult to test. MVC encourages loosely coupled code which enables TDD.


    Web forms or MVC?

    Of course web forms have their place; they may provide a better fit for developers with less experience of web development as it’s more like windows forms development; they are arguably better for Rapid Application Development (RAD), though this has a cost when it comes time to change and maintain.

    Microsoft fully supports both approaches and plan to do so for the foreseeable future so either approach is valid.  At Dataworks we like what we’ve seen with MVC and most of our new web application development is adopting this approach.



  • Back to Blogs