Net::FTP::Common is 3 years old now. It has had a few nice contributions and one public presentation. Since the code base has stabilized, I felt it was time for some changes. However, thinking about the changes made me wonder whether each one was worth it. Your input is appreciated.





SUMMARY

I am considering using one of fields (core Perl), Class::Struct (core Perl), Attribute::Property (external) to make the changes discussed above. Which would you choose?

edited: Sun Sep 28 14:39:29 2003 by jeffa - switched table format to unordered list (ybiC changed pre tags to code)

Replies are listed 'Best First'.
Re: Balancing Concerns in Upgrading Net::FTP::Common
by simonm (Vicar) on Sep 28, 2003 at 03:32 UTC

    Accessors: I'd suggest using Class::Struct, although any of the three class-builders would do. The lvalue methods are neat, but I wouldn't depend on them.

    Strict Hash Slots: This is trivial if you're using accessor methods -- replace your constructor behavior with something like the below, and any unsupported arguments will result in a "no such method" error:

    my $self = bless {}, $class; while ( my($method, $value) = splice @_, 0, 2 ) { $self->$method( $value ); } return $self;

    API Delegation: While accessing the internal Net::FTP object is a decent solution, I agree with your instinct to add delegation methods that correspond with the most useful bits of the API, or even to build them on demand using autoload.