Net::FTPServer is my favorite module because it provides the best example of separation of concerns.

What I mean by this is that it separates the functional requirements of an FTP server from the actual implementation of those requirements, thereby allowing numerous and flexible means of handling the functional requirements.

It provides two means of connecting the perceived behavior of the FTP server to the actual means of implementation - hooks and subclassing. By hooks, I mean small subroutines which are called at various phases of FTP service processing (ie, pre-connect, post-connect, pre-login, post-login, pre-command, post-command, pre-transfer, during-transfer, post-transfer) which provide control of the service process. These hooks are methods whose implementation can be over-ridden in subclasses to provide almost any type of desired functionality at any phase of processing.

On one assignment, for example, we over-rode the authentication hook so that we could use our database of users for authentication. We also over-rode the file-listing and directory-changing methods so that we could list files on two remotely networked repositories but still provide a single FTP front-end to them.

When you are thinking of designing a scaleable , customizable piece of software, be sure to download Net::FTPServer and take a good look at its architecture first.


In reply to Net::FTPServer - A Good Example of Separating Functional Specification from Implementation by princepawn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.