darya/framework

Reduce router complexity

Opened this issue · 1 comments

Improve the simplicity of Router by once again extracting Dispatcher.

Instead of a dispatcher accepting a router, a router should be able to accept different dispatchers and also have a default implementation that it instantiates for itself (i.e. the current implementation).

Not only does this enhance the coherence of the framework, it also allows for custom dispatchers to be provided to the router.

hexus commented

Maybe custom dispatchers would be overkill, but resolving controllers and dispatching them can indeed be extracted.