ASP.NET MVC vs ASP.NET(Webforms) vs Ruby On Rails
Mon, Feb 4 2008 11:13 PM
What is MVC
MVC stands for:
Controller (business logic)
View (what you see + view logic)
It is used to separate the logic from a web application and other types of applications into these 3 logical parts.
There are a lot of people who think this makes development easier and more maintainable. For more information on MVC click here.
What is Ruby On Rails
Ruby On Rails, ROR for short is the framework which took the world by storm.
Or it just caused a storm, one or the other, but I guess it made the whole MVC idea a whole lot more famous.
Ruby is the language on which this framework is built, the characteristics of Ruby as it stands now is that the language is very powerful and expressive but runs pretty slow
What is ASP.NET (Webforms)
ASP.NET is currently set up in a way that it tries to mimic windows programming as much as possible.
This means that it is event driven and supports concepts which make it more like a statefull windows program.
This means that you can for instance drag a button on a webform and double click this button to add an action to it.
Double click the form, to type in an action which is done when the page is loaded.
This means that this form of programming is a form of event driven programming.
What is ASP.NET MVC
ASP.NET MVC is the Microsoft implementation of MVC.
It does away with the event driven programming and it doesn't try to be statefull. With these choices it gains a few things and loses a few others.
Differences Between them in a feature chart
I think the best way to highlight some of the differences between the platforms is to highlight these difference in some charts. So without further ado let's have a look at the differences:
Webforms vs MVC
| ||Webforms ||MVC|
|URL's ||through pagenames / URL rewriting. |
programmaticly set up the url's by default this works through REST like interfaces.
|Event driven ||Yes ||No|
|Statefull ||Yes (Viewstate) ||No|
|Easily unit tested ||No ||Yes |
|Easily View tested ||same ||same|
|Can use designer easily ||Yes ||No (I think)|
|Double Click to get action ||Yes ||No|
|Different view engines supported ||No ||Yes|
|Support AJAX easily ||Yes ||Yes |
|Support ASP.NET Request / Response objects ||Yes ||Yes|
|Supports Dynamic Languages ||Yes ||Yes|
|Can play well with the other ||Yes ||Yes|
|Abstraction from html ||Yes ||No|
|Exact control over html ||No ||Yes|
|Support ORM ||Yes ||Yes|
|Will be able to use library of third party controls for ASP.NET ||Yes ||Partial (no state / postback controls only)|
|Works on Linux / Mono ||Yes (Partial) ||No|
ASP.NET MVC vs Ruby On Rails
| ||ASP.NET MVC ||Rails|
|Compiled ||Yes ||No|
|Intellisence ||Mostly ||Depending on editor|
|Has free IDE ||Yes ||Yes|
|Can be easily deployed on shared hosting ||Yes ||not really |
|Can be easily deployed on windows ||Yes ||No|
|Can be deployed on Linux ||No (Maybe if mono picks it up) ||Yes|
|Has a built in ORM ||No (not yet) ||Yes|
|Has out of the box for multiple Databases ||No ||Yes|
|Is resource efficient ||Yes ||No|
|Extensive caching options ||Yes ||Yes |
|All URL available ||Yes ||Yes|
|REST possible ||Yes ||Yes|
|.Net Framework available ||Yes ||No|
|Ruby Runtime available ||Through interop / CLR implementations ||Yes|
|Has an active community around it ||Yes ||Yes|
I'm missing feature X from this chart
Could be, it's not a complete list of features.
It's just a list of things which seemed nice to compare if you want you can always comment about your favorite pet difference between one of these frameworks / development methods.
Generalisations / when to use which option
The charts above will mostly tell you when you can't use one of the options in the list.
All the platforms will keep evolving but each has it's own strengths and weaknesses at the moment.
ROR is great for when your working on a non windows platform and want to write as few lines as possible and want to work in Ruby.
Webforms is great for when you want quick results with nice building blocks from 3rd party developers and you don't need exact control over your html.
ASP.NET MVC is great for when you want complete control over your html and url's and want unit testing like there is no tomorrow.
My webdevelopment method of choice for now remains to be Webforms this is mainly because of a lot of nice development speed enhancements which are present in this platform.
It's something which makes the easy things pretty fast to do and makes the harder things quite hard and complicated.
I might be going over to some other platform / framework based on what lies ahead in terms of websites / applications to create.
Only time will tell, but for now I remain satisfied with Webforms for a RAD platform.
But what about testing ?
There are a lot of people who like setting up unit tests along with their regular development.
I think my opinion on this is a subject for a whole other posting so I won't go into it any further at this time :)
We are living in a golden age for Internet development there are a lot of options in the web development world, and the possibility's are still growing and evolving at a brake neck pace.
All the choices above will probably be used to amaze us with things that are possible and all will probably still have a place in developers hearts for quite some years to come.
The question is what will the new players bring 5 years from now, and how will these technologies stand up to each other then.