Closed mnapoli closed 9 years ago
Is it the responsibility of the Action to call the responder?
Not necessarily. The primary point here is in how the concerns are separated. As long as the response-building work is separated from everything else, the "action" ends up being so trivial as to be (almost) nonexistent. Having said that, having the action call the responder seems to make the most sense. Cf. the Arbiter library, which is a uniform/universal action system capable of invoking any domain callable and any responder callable.
p.s.: It seems to me that "calling a responder" is out-of-scope for a router, in the same way that "calling the domain" would be out-of-scope. A router identify the route information, then hand that route off for dispatching. But maybe that's just me.
Thanks that answers my questions.
It seems to me that "calling a responder" is out-of-scope for a router, in the same way that "calling the domain" would be out-of-scope. A router identify the route information, then hand that route off for dispatching. But maybe that's just me.
No I agree with that too ;) I don't expect a router library to do this (e.g. Aura Router). But sometimes in a framework you can consider "the router part" (request-route matching, dispatching, …) as a whole and that's more what I had in mind (i.e. I wasn't using the best words ;) ).
(/me nods)
Fair enough. Let me know if you have other questions/comments!
In your examples, the action calls the responder. Is there a reason for that? Shouldn't it be the routing system that does that (when using a router that can do that of course)?