Back a year ago when I was preparing for my Monorail presentation at CINNUG (see Monorail: part I, part II – in particular part II), it was greatly impressed on me that Monorail sat on top of ASP.NET, just like WebForms sits on top of ASP.NET. The key being that Webforms does not equal asp.net – WebForms != ASP.NET.
ASP.NET has a great design to it, as it is a the underlying ‘pipeline’, handling the HttpRequest/HttpResponse, and all the core stuff like Authentication, Authorization, Session, Caching, etc.
WebForms, Monorail, MVC, Dynamic Data, etc… all sit on top of asp.net. This is brilliant, as I’m able to incorporate different parts and pieces – ie. when mvc first came out, I was able to progressively upgrade parts of my webform project – in a hybrid manner. Some pieces I didn’t really want to upgrade, as it worked fine – other parts made it cleaner and easier to test and maintain. It made refactoring possible.
Scott Hanselman has been pushing this message, and I’m glad to see it. In this blog post "Plug-In Hybrids: ASP.NET WebForms and ASP.MVC and ASP.NET Dynamic Data Side By Side" he outlines this:
I wanted to write this post because there seems to be a lot of confusion about how ASP.NET WebForms, MVC and Dynamic Data all fit together. Folks may have WebForms applications and want to start looking at ASP.NET MVC but aren’t sure if they need to start from scratch or not. Folks might look at Dynamic Data but mistakenly assume it’s just for scaffolding administrative sites.
You can (and should) feel free to have Hybrid applications. You can have single Web applications that have all of these inside them (if it makes you happy):
- ASP.NET MVC
- ASP.NET WebForms
- ASP.NET Web Services (ASMX)
- WCF Services
- ASP.NET Dynamic Data
- ASP.NET AJAX
I hope this helps and it’s more clear now that it’s just "an ASP.NET application."
You can feel free to mix and match. Not everyone can (or should) rewrite an existing ASP.NET application, so it is nice that everyone can use some new features in the same ASP.NET application as their existing functionality.
I think all of this is very interesting, and the more one grasps what ‘asp.net’ is – the best underlying of how all of these different ‘frameworks’ work.