Hello,
What's the best design pattern to use for an HTTP Request Dispatcher that has to do a "GET" or a "POST", return an output stream, parse the output stream, and then display the parsed results on an interface?
Currently, I have an HttpRequestDispatcher.java in which a UI Class is defined in its constructor, and in the threaded run() method, the results are sent to UIClass.requestSucceeded or UIClass.requestFailed, where the stream is then parsed and the results displayed.
The problem with this is I really want a separation of concerns between the interface, the parser, and the dispatcher. This way, in the future, I can really re-use the dispatcher with many other classes...Right now, I have to have one HttpRequestDispatcher for every "Screen"...
Would appreciate any advice, thanks!