Introduction
This article offers a simple solution to mapping URL requests within HttpHandler (or HttpModule, if needs to be) to the form of {controller}/{action}, much like with MVC Routing, but without using MVC.
The solution is based on a small and independent class SimpleRouter, optimized for work in a performance-demanding application.
Background
The mechanism of automatic URL routing is one of MVC's greatest virtues, allowing developers to designate areas, controllers and actions to reflect logic of their application in the most intuitive way, and not just internally, but on the protocol (URL) level at the same time.
Once you have started using this approach, it is difficult to part with. However, there are certain tasks where you may want to stay away from it, and I do not mean the URL routing itself, but the entire MVC platform. Such tasks may include, but not limited by:
Stay tuned to my blog, twitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.
This article offers a simple solution to mapping URL requests within HttpHandler (or HttpModule, if needs to be) to the form of {controller}/{action}, much like with MVC Routing, but without using MVC.
The solution is based on a small and independent class SimpleRouter, optimized for work in a performance-demanding application.
Background
The mechanism of automatic URL routing is one of MVC's greatest virtues, allowing developers to designate areas, controllers and actions to reflect logic of their application in the most intuitive way, and not just internally, but on the protocol (URL) level at the same time.
Once you have started using this approach, it is difficult to part with. However, there are certain tasks where you may want to stay away from it, and I do not mean the URL routing itself, but the entire MVC platform. Such tasks may include, but not limited by:
Stay tuned to my blog, twitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.
No comments:
Post a Comment