Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] send-email: support NNTP

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:00

Junio C Hamano [off-list ref] writes:
l.stelmach@samsung.com (Łukasz Stelmach) writes:
quoted
OK, I see. Good point. Where would you recommend me to put these modules
and how to name them? I mean I don't want to make to much mess here (;
I would not recommend you to do any of the above now.  As I said, the
open-coded if/elsif cascade version you posted is fine as a starting
point.  I'd prefer to see it made work correctly as advertised first
with documentation updates and tests.

A Perl guru might want to come and refactor the result once the code
solidifies, but that should be left as a separate series.
An alternative structure of the patch, if you are feeling brave,
could go like this:

 (1) With a thought process similar to what I illustrated in my
     message you responded with "OK, I see. Good point.", identify
     all the codepaths that will need to become methods that are
     specific to the transport (SMTP or NNTP).

 (2) Without adding any NNTP goodies, refactor the current code to
     use a single class for driving conversation with a SMTP server.
     You will implement all the methods you identified in the
     previous step and the result will become "[PATCH 1/2]
     send-email: refactor to use a transport-specific class".

 (3) Implement a new class to drive conversation with an NNTP
     server, that has the same set of methods as the SMTP one you
     wrote in the previous step.  The result will become "[PATCH
     2/2] send-email: introduce NNTP transport".  This would need
     updates to the documentation.

I do not necessarily suggest you to go this route, by the way. It is
up to you and depends on how proficient you are (and how comfortable
you feel) dealing with modular Perl programs.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help