views:

54

answers:

3

Hi - I would like to know how I can go about implementing my own version of a MVC framework in ASP.NET? I know there already is Microsoft provided ASP.NET MVC framework, but I want to learn MVC and thought the best way would be to implement my own flavor of a MVC framework on top of ASP.NET. Any thoughts / guidance ?

Also, can anyone point me to a page where I can learn more about how microsoft implemented ASP.NET MVC ? I'm more interested in learning about the under the hood plumbing that goes on to implement the framework on top of asp.net, do they use HttpHandlers / HttpModules ?

Thanks.

+1  A: 

You can get the source for ASP.NET MVC from here: http://aspnet.codeplex.com/releases/view/41742

Michael Dean
Reading in the source seems to be the best approach to dig deep in the ASP.NET fundamentals. Your questions regarding HttpModules and handlers will be answered here not only on 'if' but also on 'how'.
Sebastian P.R. Gingter
thanks, is there a whitepaper/study/article that I can read about the architecture?
ace
You can read more here: http://www.asp.net/learn/whitepapers/what-is-new-in-aspnet-mvc/
Michael Dean
Couple more sites: This covers basic architecture http://www.asp.net/mvc/whatisaspmvc/ and this is the main site that has samples, videos, etc. http://www.asp.net/mvc/
Michael Dean
+2  A: 

You want to learn about a concept by reinventing an existing framework that already does that concept better than you will? That sounds like quite a rabbit hole to venture into.

Why not learn MVC by learning ASP.NET MVC? What's your reasoning for why that's not a valid way to learn the concepts? Learning a proven framework will be a much better approach than what you're considering.

EDIT: One other thing to consider. Knowing how to use ASP.NET MVC (or Rails, or insert-MVC-framework-here) would be a much more useful and marketable skill than the ability to roll your own MVC framework from scratch (even though that might prove more intellectually stimulating).

bmoeskau
I understand what you mean, however my aim is not to learn ASP.NET MVC but to learn how actually it was implemented in ASP.NET.
ace
+1  A: 

MVC is an architectural pattern that is not dependent on ASP.NET or any framework.

I would not advise trying to implement it on top of ASP.NET if you are just looking to learn about the Model View Controller pattern. ASP.NET will impose too many implementation details when you should instead be concentrating on the overall concept such as separation of concerns, single responsibility.

The ASP.NET MVC framework is simply an implementation of the Model View Controller pattern that runs on top of ASP.NET. Like most implementations it contains variations on the basic MVC pattern to better suit web applications and the underlying framework. So trying to re-implement ASP.NET MVC will give you a non-standard understanding of the pattern.

Martin Fowler explains the fundamental ideas of MVC in the book: Patterns of Enterprise Application Architecture.

Ash