NetSDS::Feature - abstract application feature
package NetSDS::Feature::DBI; use DBI; use base 'NetSDS::Feature'; sub init { my ($self) = @_; my $dsn = $self->conf->{dsn}; my $user = $self->conf->{user}; my $passwd = $self->conf->{passwd}; $self->{dbconn} = DBI->connect($dsn, $user, $passwd); } # Sample method - DBI::do proxy sub do { my $self = shift @_; return $self->{dbconn}->do(@_); } 1;
Application features are Perl5 packages with unified API for easy integration of some functionality into NetSDS applications infrastructure.
features
NetSDS::Feature module contains superclass for application features providing the following common feature functionality:
NetSDS::Feature
* class construction * initialization stub * logging
This method should be rewritten with feature functionality implementation.
This method allows to use application methods and properties.
print "Feature included from app: " . $self->app->name;
This method provides access to feature configuration.
See NetSDS::Logger documentation for details.
See samples/app_features.pl script.
samples/app_features.pl
Unknown yet
NetSDS::App
None
Michael Bochkaryov <misha@rattler.kiev.ua>
To install NetSDS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm NetSDS
CPAN shell
perl -MCPAN -e shell install NetSDS
For more information on module installation, please visit the detailed CPAN module installation guide.