About a week ago I started learning ASP.NET MVC framework. It is pretty cool entertainment for cold winter nights as I found out. Here you can find how I got started and what resources I used.
Here are the steps I made to get started:
- I installed last versions of Visual Web Developers 2008 Express Edition and ASP.NET MVC framework.
- I tried out some simpler examples to find out how things work and how code is organized.
- I decided to write a little, simple and minimalistic pet portal that looks like real thing. This keeps me away from simple-sample-code mode, so I have to deal with every detail.
- As a first thing I played with routings to find out how they work and how it is related to code. Okay, I had my own idea what kind of URLs I like and I achieved it without any additional extensions.
- Then I started to play with controllers and views. I wanted to find out how the code is executed and how I can write my own code to make things happen. It is also important to play with views because things are different than in case of usual ASP.NET pages and user controls.
- Next thing was including models, so instead of VC I have MVC in my application.
- Currently I’m integrating AJAX and validation framework to my MVC application.
It is good to learn new stuff as much as possible. I refactored my code more than one time – it is really good refactoring training, believe me.
Why should one consider using ASP.NET MVC framework? There are some reasons I found to be important enough to write up:
- MVC pattern keeps your code very well layered.
- Your code can be easily tested (by example: unit tests, integration tests).
- You have better control over your mark up and you can optimize it the way you like it.
Of course, there are scenarios when classic ASP.NET web applications are better choice. If you have data intensive applications like intranets or other special purpose applications then you may want to use also very powerful UI components from 3rd party providers. Of course, all these things are also possible on MVC framework – just find components you need or write your own components and go live. :)
View Comments (2)
Pingback from ASP.NET MVC Archived Blog Posts
Hi Vaibhav thanks for comminteng.I've been mulling it over, over the course of the day. Here are the salient points.1: I've not invested in WebForms knowledge massively though my knowledge of yer basic/raw HTML is pretty good.2: Almost everything I do is test-driven.3: I'm pretty happy with a Winforms-like programming interface.4: I hate code and HTML being mushed together.5: I get to choose, and I carry the can if it goes wrong Points to MVC, I'd say. Now the choice is between the standard view engine, Brails (Boo==love) or the NHAML renderer. I think I'll need to sit down and do a couple of hours playing.The rest of the stack will be the Castles projects ActiveRecord with ActiveWriter providing the modelling environment. I'll have to hack ActiveWriter to allow better attributing of properties though.\m