3 ms·
Short advice: avoid inheritance, favour composition. Some other things I would do: - Simplify API: (/service/${STATE}) - Create a dictionary of ${STATE} to R
by gitgud 7y ago
Short advice: avoid inheritance, favour composition.
Some other things I would do:
- Simplify API: (/service/${STATE})
- Create a dictionary of ${STATE} to RequestHandler's for all cases, and a default case.
- Divide as much functionality into reusable stateless functions.
- Compose RequestHandler's with reusable functions.
Now when the server receives a request with ${STATE} it can look up the appropriate handler in the dictionary and process the request.
- ortne 7y agoThanks for the advice! This seems like a reasonable approach I might give a test drive.