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.
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).
You can get the source for ASP.NET MVC from here: http://aspnet.codeplex.com/releases/view/41742
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.
精彩评论