GenOO::RegionCollection::Factory::DB - Factory for creating GenOO::RegionCollection object from a database table
# Creates GenOO::RegionCollection object from a database table # Preferably use it through the generic GenOO::RegionCollection::Factory my $db_factory_implementation = GenOO::RegionCollection::Factory->new('DB', { driver => undef, host => undef, database => undef, table => undef, record_type => undef, user => undef, password => undef, port => undef, } );
An instance of this class is a concrete factory for a GenOO::RegionCollection object. It offers the method "read_collection" (as the consumed role requires) which returns the actual GenOO::RegionCollection object in the form of GenOO::RegionCollection::Type::DB. The latter is the implementation of the GenOO::RegionCollection class based on a database table.
# Create a concrete factory my $factory_implementation = GenOO::RegionCollection::Factory->new('DB', { file => 'sample.sam' } ); # Return the actual GenOO::RegionCollection object my $collection = $factory_implementation->read_collection; print ref($collection) # GenOO::RegionCollection::Type::DB
To install GenOO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GenOO
CPAN shell
perl -MCPAN -e shell install GenOO
For more information on module installation, please visit the detailed CPAN module installation guide.