On 13/03/11 23.44, Andrei Alexandrescu wrote:
You'll probably need to justify the existence of a class hierarchy and
what overridable methods there are. In particular, since you seem to
offer hooks via delegates, probably classes wouldn't be needed at all.
(FWIW I would've done the same; I wouldn't want to inherit just to
intercept the headers etc.)

Missed this one in my last reply.

Ftp/Http etc. are all inheriting from a Protocol class. The Protocol class defines common settings (@properties) for all protocols e.g. dnsTimeout, connectTimeout, networkInterface, url, port selection.

I could make these into a mixin and thereby get rid of the inheritance of course.

I think that keeping the Protocol as an abstract base class would benefit e.g. the integration with streams. In that case we could simply create a CurlTransport that contains a reference to a Protocol derived objects (Http,Ftp...).

Or would it be better to have specific HttpTransport, FtpTransport?


/Jonas

Reply via email to