Software Index
Linux Software Programming  

Badger::Class

download download home home   report broken
important software information
company name:
Andy Wardley
license: Freeware
minimum requirements:
functional limitations:
Badger::Class description
Badger::Class is a class metaprogramming Perl module.

SYNOPSIS

# composing a new module
package Your::Module;

use Badger::Class
base => 'Badger::Base', # define base class(es)
version => 1.00, # sets $VERSION
debug => 0, # sets $DEBUG
throws => 'wobbler', # sets $THROWS error type
import => 'class', # import class() subroutine
utils => 'blessed params',# imports from Badger::Utils
codec => 'storable', # imports from Badger::Codecs
codecs => 'base64 utf8' # codecs do encode/decode
constants => 'TRUE FALSE', # imports from Badger::Constants
constant => { # define your own constants
pi => 3.14,
e => 2.718,
},
words => 'yes no quit', # define constant words
accessors => 'foo bar', # create accessor methods
mutators => 'wiz bang', # create mutator methods
as_text => 'text', # auto-stringify via text() method
is_true => 1, # overload boolean operator
overload => { # overload other operators
'>' => 'more_than',
' 'less_than',
},
vars => {
'$FOO' => 'Hello World', # defines $FOO package var
'@BAR' => [10,20,30], # defines @BAR
'?Z' => {x=>10, y=>20}, # defines ?Z
# leading '$' is optional for scalar package vars
WIZ => 'Hello World', # defines $WIZ as scalar value
WAZ => [10,20,30], # defines $WAZ as list ref
WOZ => {a=>10,y=>20}, # defines $WOZ as hash ref
WUZ => sub { ... }, # defines $WUZ as code ref
},
methods => { # create/bind methods
wam => sub { ... },
bam => sub { ... },
},
exports => { # exports via Badger::Exporter
all => '$X $Y wibble', # like @EXPORTS
any => '$P $Q pi e', # like @EXPORT_OK
tags => { # like %EXPORT_TAGS
xy => '$X $Y', # NOTE: 'X Y Z' is syntactic
pq => '$P $Q', # sugar for ['X', 'Y', 'Z']
},
hooks => { # export hooks - this synopsis
one => sub { ... }, # shows the various hooks that
two => sub { ... }, # Badger::Class defines: base,
}, # version, debug, etc.
},
messages => { # define messages, e.g. for
missing => 'Not found: %s', # errors, warnings, prompts, etc.
have_u => 'Have you %s my %s?',
volume => 'This %s goes up to %s',
}; # Phew!

# the rest of your module follows...
our $X = 10;
our $Y = 20;
sub whatever { ... }

# Other Badger::Class tricks
use Badger::Class 'class';

# compose a new class on the fly
class('Amplifier')
->base('Badger::Base')
->constant( max_volume => 10 )
->methods( about => sub {
"This amp goes up to " . shift->max_volume
} );

Amplifier->about; # This amp goes up to 10

# when you need that push over the cliff...
class('Nigels::Amplifier')
->base('Amplifier')
->constant( max_volume => 11 );

Nigels::Amplifier->about; # This amp goes up to 11

Badger::Class is a class metaprogramming module. It provides methods for defining, extending and manipulating object classes and related metadata in a relatively clean and simple way.

Using the Badger::Class module will automatically enable the strict and warnings pragmata in your module (thx Moose!). No exceptions. No questions asked. No answers given. It's for your own good.. .
Similar software
Class::STL::Containers for Linux (Popularity: ) : Class::STL::Containers is a Perl modulethat provides a framework for rapid Object Oriented Perl application development. It consists of a number of base classes that are similar to the C++/STL framework, plus a number of helper classes which provide the glue ...
Catalyst::View::PHP (Popularity: ) : Catalyst::View::PHP is the Catalyst view class for the PHP::Interpreter. Your application subclass should inherit from this class. This plugin renders the template specified in $c->stash->{template}, or failing that, $c->request->match. The template variables are set up from the contents of $c->stash, ...
Chicken (Popularity: ) : CHICKEN is a compiler for the Scheme programming language. It produces portable, efficient C, supports almost all of the current Scheme language standard, the Revised5 Report on the Algorithmic Language Scheme (R5RS ), and includes many enhancements and extensions. CHICKEN ...
SNMP (Popularity: ) : SNMP is a Perl5 'SNMP' extension module for the Net-SNMP SNMP package.

Note: The perl SNMP 5.0 module which comes with net-snmp 5.0 and higher is different than previous versions in a number of ways. Most importantly, it behaves like a ...

django-ajax-filtered-fields (Popularity: ) : django-ajax-filtered-fields contains Django fields which may be used in a many to many or foreign key relation, where the user may want to apply filters to the listed objects, because of they being too many, or just for usability reasons.

Technical ...

Geo::Coordinates (Popularity: ) : Geo::Coordinates is a Perl class for geographical coordinates.

SYNOPSIS

use Geo::Coordinates;
my $place = new Geo::Coordinates;. The CPAN Search Site - search.cpan.org. Publisher of Geo::Coordinates, Author of Geo::Coordinates 0.04. Geo::Coordinates is a Perl class for geographical coordinates. SYNOPSIS use Geo::Coordinates; my ...

Fry::Lib::CDBI::Load (Popularity: ) : Fry::Lib::CDBI::Load is a Perl module that sets up a Class::DBI connection and basic variables expected by any Class::DBI library.

This module sets up a Class::DBI connection either using Class::DBI::Loader or with an explicit &set_db call. When the flag CDBI_Loader is set, ...

django-uni-form (Popularity: ) : Django forms are easily rendered as paragraphs, tables, and unordered lists. However, elegantly rendered div based forms is something you have to do by hand. The purpose of this application is to provide a simple tag and/or filter that lets ...
Data::Walk (Popularity: ) : Data::Walk is a module to traverse Perl data structures.

SYNOPSIS

use Data::Walk;
walk &wanted, @items_to_walk;

use Data::Walk;
walkdepth &wanted, @items_to_walk;

use Data::Walk;
walk { wanted => &process, follow => 1 }, $self;

The above synopsis bears an amazing similarity to File::Find(3pm) and ...

Visual Paradigm for UML (Professional Edition) for Linux (Popularity: ) : Visual Paradigm for UML is an easy-to-use UML modeling tool that supports the latest UML notation (class diagram, use case diagram, sequence diagram, collaboration diagram, statechart diagram, activity diagram, component diagram, deployment diagram).+Round-trip engineering+Instant Reverse for XML, Dot NET dll/exe, ...
calibre for Linux (Popularity: ) : calibre is a e-book library management application. It is free, open source and cross-platform in design and works on Linux, OSX and Windows. calibre is meant to be a complete e-library solution and thus includes, library management, format conversion, news ...
Benchmark::Harness (Popularity: ) : Benchmark::Harness is a Perl module used to test Perl applications.

SYNOPSIS

Benchmark::Harness will invoke subroutines at specific, parametizable points during the execution of your Perl program. These subroutines may be standard Benchmark::Harness tracing routines, or routines composed by you. The setup involves ...

User reviews

Write a review:
1 2 3 4 5 6 7 8 9 10
1=poor 10=excellent
Write review*
Your name*
Email*
  (Comments are moderated, and will not appear on this site until the editor has approved them)
 
Similar scripts
EZ Results Paging Class (Popularity: ) : EZ Results is a paging class that can be formatted in any way you choose. Have a read through the documentation to see just how unlimited it is.Once you start working with it you will be amazed at how quickly ...
School or Class Reunion PHP Script (Popularity: ) : Our PHP script allows you to setup and manage your own school or class reunion website. In most cases, your new class reunion website can be online in under an hour. On the right side of this page, checkout some ...
DateTimeFormatter class (Popularity: ) : This is an ActionScript 2.0 class. It lets you convert a Flash Date object into text formatted to show specific date and time elements in whatever order or state you desire in one simple function call.Features: - Full control over ...
DataGrid Class (Popularity: ) : A WSC DataGrid Class with examples you can just unzip and run. Nothing to register (unless you want to).
Event Calendar Generator PHP Class (Popularity: ) : Event Calendar Generator PHP Class generates calendars (year, month or week view) as a HTML Table (XHTML-Valid).Features: - can be static (without any links) - can optionally have navigation controls - can optionally have a date picker control - can ...
PHP Calendar Class (Popularity: ) : PHP Calendar is a PHP calendar class, suitable for any PHP version. It is very customisable and has the following features: - Month View - Year View - Specify start day of week - Specify start month of year for ...
PHP Database Class (Popularity: ) : This is just a simple Database class that wraps around a MySQL server. It has a few fancy features like being able to delete a record without actually deleting it. I’ll come back later and put in more documentation. I ...
Oracle Class Library (Popularity: ) : Oracle Class Library (OCL) provides native connectivity to the Oracle database server. OCL uses Oracle Call Interface (OCI) directly. OCI is low-level native application programming interface to access to Oracle. Using OCI in Oracle Class Library allows to create lightweight ...
iCommerceGateway PHP Class (Popularity: ) : iCommerceGateway is a PHP class for credit card authorizations made through iCommerceGateway's payment processing system.
Quicken QIF file class and conversion (Popularity: ) : This script contains a simple class to represent a Quicken (QIF) file, and a parser to load a QIF file into a sequence of those classes.
Rate me
supported os's
stats
downloads 5
version 0.06
size in Kb 225
popularity   
851/1272475
user rating 0/10
our rating 0 Stars
share info
Recommend Badger::Class
Report spyware
New Software
Popular Software
Latest Reviews