2016-07-19 4:52 GMT-03:00 Michael Van Canneyt <mich...@freepascal.org>:
> > 1. The whole point of TFPHTTPClient is exactly to couple it to sockets > framework (fcl-net). > If you want to use synapse, use httpsend. lnet has a similar component > for the http protocol. > > I dont want to use synapse. I am developing bindings for a c library. The library offers TCP connection functionality but does not provide any support for http. I need to use that library due to some particularities of my project. I do not understand the need for such coupling between http client and fcl-net. It is like coupling SQLDb with a specific RDBMS. > 2. I favour the opposite approach. Abstract out the underlying HTTP > implementation > at a higher level. > Why should we duplicate the code? Why should we implement the same functionality in several diferent places? > > For this I have introduced FPWebclient, which has 2 implementations: > TFPHTTPClient and Synapse. > > Through TAbstractWebClient you are introducing another level of complexity to do the same task: perform http requests. TAbstractWebClient is actually an adapter to diferent http implementations. TAbstractWebClient is an interesting class. However, It is a poor solution, IMHO. Best regards
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal