Think first, code last
I’ve got to code some of the basic stuff for FOW (simple CGI client) and figured several bad things. I didn’t make enough research for RequestHandler so now I’m somewhat collapsing due to the fact I have parts of code that couldn’t be joined together. So, I’m back to pen, paper and UML.
Now, how is the request handled? The global dispatching RequestHandler receives Request from the I/O protocol handler (e.g. CGIHandler). It then looks up request in its Array of url->handlers. The Array is a flat structure unlike Django’s urlconf. Currently that’s done to increase overall simplicity. Later on Request is being processed by some handler and Response is routed back to I/O, where CGIHandler echoes it to stdout.
Ok, let me draw this one in state diagram so I could understand it myself…