In my own implementation I found it convenient to decouple actions and responders. The wiring is done at the route level:
game_listing:
path: /listing
defaults:
_controller: game_listing_action # service id
_responder: game_listing_responder_html
The action adds any specific data that the responder needs to the request object then returns null. The responder then acts on the request and generates a response.
I did it this way mostly because the Symfony framework makes it easy to implement a responder listener. I can actually configure multiple responders based on the desired response format (html, json etc).
It also seems a bit more middleware-ish. The action does it's thing then moves onto the responder.
Just wondering if the notion of not having the action operate directly on the responder fits into your vision of ADR?
In my own implementation I found it convenient to decouple actions and responders. The wiring is done at the route level:
The action adds any specific data that the responder needs to the request object then returns null. The responder then acts on the request and generates a response.
I did it this way mostly because the Symfony framework makes it easy to implement a responder listener. I can actually configure multiple responders based on the desired response format (html, json etc).
It also seems a bit more middleware-ish. The action does it's thing then moves onto the responder.
Just wondering if the notion of not having the action operate directly on the responder fits into your vision of ADR?