This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dominic108
Recipients dominic108
Date 2017-03-30.12:08:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za>
In-reply-to
Content
I am just curious to know if someone considered the idea of passing a factory instance that returns RequestHandlerClass instances instead of directly passing the class? It may affect existing handlers that read non local variables, but there should be a way to make the factory optional. The purpose is only aesthetic and a better organization of the code. I find it awkward to have to subclass the server every time that we have an handler that needs special objects, a database connection, a socket connection to another party, etc. The server class should have a single purpose: accept a request and pass it to an handler. We should only need to subclass a server when we need to do that in a different way : TCP vs UDP, Unix Vs INET, etc. The usage is simpler and more natural. Instead of subclassing the server, we create a factory for the handler.
History
Date User Action Args
2017-03-30 12:08:53dominic108setrecipients: + dominic108
2017-03-30 12:08:53dominic108setmessageid: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za>
2017-03-30 12:08:53dominic108linkissue29947 messages
2017-03-30 12:08:53dominic108create