<div dir="ltr">2016-07-19 4:52 GMT-03:00 Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span>:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
1. The whole point of TFPHTTPClient is exactly to couple it to sockets<br>
   framework (fcl-net).<br>
   If you want to use synapse, use httpsend. lnet has a similar component<br>
   for the http protocol.<br>
<br></blockquote><div><br></div><div>I dont want to use synapse. I am developing bindings for a c library. <span id="result_box" class="" lang="en"><span>The library</span> <span>offers</span> <span>TCP</span> <span class="">connection functionality</span> <span>but</span> <span class="">does not provide any support for http. </span></span><span id="result_box" class="" lang="en"><span class=""><span id="result_box" class="" lang="en"><span class="">I need to use</span> <span>that library</span> due to some<span> particularities</span> <span class="">of my project.<br><br></span></span></span></span></div><div><span id="result_box" class="" lang="en"><span class=""><span id="result_box" class="" lang="en"><span class="">I do not understand the need for such coupling between http client and fcl-net. </span></span></span></span><span id="result_box" class="" lang="en"><span class=""><span id="result_box" class="" lang="en"><span class=""><span id="result_box" class="" lang="en"><span>It is like</span> coupling SQLDb<span></span> <span>with</span> a specific RDBMS.</span></span></span></span></span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
2. I favour the opposite approach. Abstract out the underlying HTTP implementation<br>
   at a higher level.<br></blockquote><div><br>Why should we duplicate the code? Why should we implement the same functionality in several diferent places?<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
   For this I have introduced FPWebclient, which has 2 implementations:<br>
   TFPHTTPClient and Synapse.<br>
<br></blockquote><br></div><div class="gmail_quote">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.<br><br></div><div class="gmail_quote">Best regards<br></div></div></div>