Anyone familiar with ASP. NET should know that ASP. NET's routing system has two major functions:
1) Check the URL of a request and infer the action on the Controller to be called.
2) generate an output URL.
In the Mono Project, I defined a route publishing system (also known as the routing Supply Module) to allow my routes to contain various data and functions, such as priorities, add some data to datatokens, instead of providing it when defining the route, and create a new icontainer lifetiemscope every time the request arrives. At the end of processing the request, the lifetiemscope is automatically released ., however, as long as the "irouteprovider" interface is implemented for subsequent route registration, the application can automatically add the route to the global route table.
Basic design class diagram of this module
This module features:
1. You need to register a route and implement a class from the irouteprovider interface.
2. You can create a new route publisher from the iroutepublisher interface to provide your own route publishing program.
3. Although the custom route (monoroute) is defined ). In fact, this is the decorator mode mentioned in the design mode, which encapsulates an actual routebase object. That is, a route object provided by the irouteprovider interface.
4. Custom routehandler, httphandler, and httpasynchandler are also encapsulated objects actually used in MVC, such as routemvchandler.
It mainly provides some actions for getting data from the IO container and releasing resources.
Some designs of the "routing" section in your "Mono" Project