Posts

Showing posts from April, 2010

MVC to the rescue

Recently I came across ASP.NET MVC which was just released last year. It brings a lot of change to the traditional forms based pattern for web pages. Some of them that we could talk about are: 1. Clear separation between the Model, View and Controller 2. Controller handles events and updates the model. Creates a view bag. 3. View uses the view bag to render the view. 4. Data that is posted to the controller is mapped as an API call, the arguments being the form parameters 5. Testing becomes much easier as the controller can be tested independantly of the view 6. View just has to know about the view bag and render accordingly. No application logic can be embedded into the view because there is no handler. 7. Controller can work with the Model not directly but using DI and appropriate IoC container, it could even be a Model proxy or facade instead of the Domain.