Main > Free Download Search >

Free this class consists exclusively software for linux

this class consists exclusively

Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 3343
Class::Container 0.12

Class::Container 0.12


Class::Container is a Perl module with Glues object frameworks together transparently. more>>
Class::Container is a Perl module with Glues object frameworks together transparently.

SYNOPSIS

package Car;
use Class::Container;
@ISA = qw(Class::Container);

__PACKAGE__->valid_params
(
paint => {default => burgundy},
style => {default => coupe},
windshield => {isa => Glass},
radio => {isa => Audio::Device},
);

__PACKAGE__->contained_objects
(
windshield => Glass::Shatterproof,
wheel => { class => Vehicle::Wheel,
delayed => 1 },
radio => Audio::MP3,
);

sub new {
my $package = shift;

# windshield and radio objects are created automatically by
# SUPER::new()
my $self = $package->SUPER::new(@_);

$self->{right_wheel} = $self->create_delayed_object(wheel);
... do any more initialization here ...
return $self;
}

This class facilitates building frameworks of several classes that inter-operate. It was first designed and built for HTML::Mason, in which the Compiler, Lexer, Interpreter, Resolver, Component, Buffer, and several other objects must create each other transparently, passing the appropriate parameters to the right class, possibly substituting other subclasses for any of these objects.

The main features of Class::Container are:

Explicit declaration of containment relationships (aggregation, factory creation, etc.)
Declaration of constructor parameters accepted by each member in a class framework
Transparent passing of constructor parameters to the class that needs them
Ability to create one (automatic) or many (manual) contained objects automatically and transparently

<<less
Download (0.019MB)
Added: 2006-10-06 License: Perl Artistic License Price:
1113 downloads
Class::DBI::ConceptSearch 0.04

Class::DBI::ConceptSearch 0.04


Class::DBI::ConceptSearch is a Perl module to retrieve Class::DBI aggregates from high-level conceptual searches. more>>
Class::DBI::ConceptSearch is a Perl module to retrieve Class::DBI aggregates from high-level conceptual searches.

SYNOPSIS

my $cs = Class::DBI::ConceptSearch->new(xml => $config); #see CONFIGURATION
$cs->use_wildcards(1);
$cs->use_implicit_wildcards(1);
$cs->use_search_ilike(1);
$cs->use_search_lower(1);

my(@tracks) = $cs->search( albums => Britney );

Given the example Class::DBI classes (Music::CD, Music::Artist, Music::Track), lets add another one, Music::Dbxref, which contains external database accessions outside our control. Music::Dbxref includes things like UPC IDs, ASIN and ISBN numbers, vendor and manufacturer part numbers, person IDs (for artists), etc.

<<less
Download (0.007MB)
Added: 2006-09-20 License: Perl Artistic License Price:
1129 downloads
Class::Struct::FIELDS 1.1

Class::Struct::FIELDS 1.1


Class::Struct::FIELDS module combine Class::Struct, base and fields. more>>
Class::Struct::FIELDS module combine Class::Struct, base and fields.

SYNOPSIS

(This page documents Class::Struct::FIELDS v.1.1.)
use Class::Struct::FIELDS;
# declare struct, based on fields, explicit class name:
struct (CLASS_NAME => { ELEMENT_NAME => ELEMENT_TYPE, ... });

use Class::Struct::FIELDS;
# declare struct, based on fields, explicit class name
# with inheritance:
struct (CLASS_NAME => [qw(BASE_CLASSES ...)],
{ ELEMENT_NAME => ELEMENT_TYPE, ... });

package CLASS_NAME;
use Class::Struct::FIELDS;
# declare struct, based on fields, implicit class name:
struct (ELEMENT_NAME => ELEMENT_TYPE, ...);

package CLASS_NAME;
use Class::Struct::FIELDS;
# declare struct, based on fields, implicit class name
# with inheritance:
struct ([qw(BASE_CLASSES ...)], ELEMENT_NAME => ELEMENT_TYPE, ...);

package MyObj;
use Class::Struct::FIELDS;
# declare struct with four types of elements:
struct (s => $, a => @, h => %, x => &, c => My_Other_Class);

$obj = new MyObj; # constructor

# scalar type accessor:
$element_value = $obj->s; # element value
$obj->s (new value); # assign to element

# array type accessor:
$ary_ref = $obj->a; # reference to whole array
$ary_element_value = $obj->a->[2]; # array element value
$ary_element_value = $obj->a (2); # same thing
$obj->a->[2] = new value; # assign to array element
$obj->a (2, newer value); # same thing

# hash type accessor:
$hash_ref = $obj->h; # reference to whole hash
$hash_element_value = $obj->h->{x}; # hash element value
$hash_element_value = $obj->h (x); # same thing
$obj->h->{x} = new value; # assign to hash element
$obj->h (x, newer value); # same thing

# code type accessor:
$code_ref = $obj->x; # reference to code
$obj->x->(...); # call code
$obj->x (sub {...}); # assign to element

# regexp type accessor:
$regexp = $obj->r; # reference to code
$string =~ m/$obj->r/; # match regexp
$obj->r (qr/ ... /); # assign to element

# class type accessor:
$element_value = $obj->c; # object reference
$obj->c->method (...); # call method of object
$obj->c (My_Other_Class::->new); # assign a new object

Class::Struct::FIELDS exports a single function, struct. Given a list of element names and types, and optionally a class name and/or an array reference of base classes, struct creates a Perl 5 class that implements a "struct-like" data structure with inheritance.

The new class is given a constructor method, new, for creating struct objects.
Each element in the struct data has an accessor method, which is used to assign to the element and to fetch its value. The default accessor can be overridden by declaring a sub of the same name in the package. (See Example 2.)

Each elements type can be scalar, array, hash, code or class.

<<less
Download (0.018MB)
Added: 2007-07-11 License: Perl Artistic License Price:
835 downloads
Class::DispatchToAll 0.11

Class::DispatchToAll 0.11


Class::DispatchToAll Perl module can dispatch a method call to all inherited methods. more>>
Class::DispatchToAll Perl module can dispatch a method call to all inherited methods.

SYNOPSIS

package My::Class;
our @ISA=qw(SomeClass SomeOtherClass More::Classes);
use Class::DispatchToAll qw(dispatch_to_all);

my $self=bless {},My::Class # not a proper constructor, I know..

# this calls some_method in all Classes My::Class inherits from
# and all classes those classes inherit from, and all ... you get
# the point.
$self->dispatch_to_all(some_method);

# saves all return values from all calls in an array
my @returns=$self->dispatch_to_all(some_method);

See the Docs of Damian Conways Module Class::Delegation for a good introduction about Dispatching vs. Inheritance.

Class::DispatchToAll enables you to call all instantances of a method in your inheritance tree (or labyrinth..).

The standard Perl behaviour is to call only the lefternmost instance it can fing doing a depth first traversial.

Imagine the following class structure:
C
/
A B C::C
/ /
A::A D
/
My::Class

Perl will try to find a method in this mess in this order:

My::Class -> A::A -> A -> B -> D -> B -> C::C -> C
(Note that it will look twice in B because B is a parent of both A::A and D))

As soon as Perl finds the method somewhere, it will short-circuit out of its search and invoke the method.

And that is exactly the behaviour Class::DispatchToAll changes.

If you use dispatch_to_all (provided by Class::DispatchToAll) to call your method, Perl will look in all of the aforementioned packages and run all the methods it can find. It will even collect all the return values and return them to you as an array, if you want it too.

<<less
Download (0.005MB)
Added: 2007-07-21 License: Perl Artistic License Price:
825 downloads
Class::Contract 1.00

Class::Contract 1.00


Class::Contract - Design-by-Contract OO in Perl. more>>
Class::Contract - Design-by-Contract OO in Perl.

SYNOPSIS

package ClassName
use Class::Contract;

contract {
inherits BaseClass;

invar { ... };

attr data1;
attr data2 => HASH;

class attr shared => SCALAR;

ctor new;

method methodname;
pre { ... };
failmsg Error message;

post { ... };
failmsg Error message;

impl { ... };

method nextmethod;
impl { ... };

class method sharedmeth;
impl { ... };

# etc.
};

Background

Design-by-contract is a software engineering technique in which each module of a software system specifies explicitly what input (or data or arguments) it requires, and what output (or information or results) it guarantees to produce in response.

These specifications form the "clauses" of a contract between a module and the client software that uses it. If the client software abides by the input requirements, the module guarantees to produce the correct output. Hence by verifying these clauses at each interaction with a module, the overall behaviour of the system can be confidently predicted.
Design-by-contract reinforces the benefits of modular design techniques by inserting explicit compile-time or run-time checks on a contract. These checks are most often found in object-oriented languages and are typically implemented as pre-conditions and post-conditions on methods, and invariants on classes.

Note that these features differ from simple verification statements such as the C assert statement. Conditions and invariants are properties of a class, and are inherited by derived classes.

An additional capacity that is often provided in design-by-contract systems is the ability to selectively disable checking in production code. This allows the contractual testing to be carried out during implementation, without impinging on the performance of the final system.

Adding design-by-contract to Perl

The Class::Contract module provides a framework for specifying methods and attributes for a class (much like the existing class definition modules Class::Struct, Class::MethodMaker, and Class::Generate). Class::Contract allows both per-object and per-class methods and attributes to be defined. Attributes may be scalar-, array-, hash-, or object-based.

Class::Contract differs from other class-specification modules (except Class::Generate) in that it also provides the ability to specify invariant conditions on classes, and pre- and post-conditions on methods and attributes. All of these clauses are fully inheritable, and may be selectively disabled. It differs from all other modules in that it has a cleaner, simpler specification syntax, and -- more importantly -- it enforces encapsulation of object attributes, thereby ensuring that the class contract cannot be subverted.

Defining classes

Class::Contract provides an explicit syntax for defining the attributes, methods, and constructors of a class. The class itself is defined using the contract subroutine. contract takes a single argument -- a subroutine reference or a block. That block is executed once and the results used to construct and install the various components of the class in the current package:

package Queue;
contract {
# specification of class Queue attributes and methods here
};

<<less
Download (0.026MB)
Added: 2007-02-21 License: Perl Artistic License Price:
976 downloads
Class::InsideOut 1.02

Class::InsideOut 1.02


Class::InsideOut is a Perl module with a safe, simple inside-out object construction kit. more>>
Class::InsideOut is a Perl module with a safe, simple inside-out object construction kit.
SYNOPSIS
package My::Class;
use Class::InsideOut qw( public private register id );
public name => my %name; # accessor: name()
private age => my %age; # no accessor
sub new { register( shift ) }
sub greeting {
my $self = shift;
return "Hello, my name is $name{ id $self }";
}
This is a simple, safe and streamlined toolkit for building inside-out objects. Unlike most other inside-out object building modules already on CPAN, this module aims for minimalism and robustness:
- Does not require derived classes to subclass it
- Uses no source filters, attributes or CHECK blocks
- Supports any underlying object type including black-box inheritance
- Does not leak memory on object destruction
- Overloading-safe
- Thread-safe for Perl 5.8 or better
- mod_perl compatible
- Makes no assumption about inheritance or initializer needs
It provides the minimal support necessary for creating safe inside-out objects and generating flexible accessors.
<<less
Download (0.047MB)
Added: 2006-09-27 License: Perl Artistic License Price:
1122 downloads
Class::ObjectTemplate 0.7

Class::ObjectTemplate 0.7


Class::ObjectTemplate is a Perl extension for an optimized template builder base class. more>>
Class::ObjectTemplate is a Perl extension for an optimized template builder base class.

SYNOPSIS

package Foo;
use Class::ObjectTemplate;
require Exporter;
@ISA = qw(Class::ObjectTemplate Exporter);

attributes(one, two, three);

# initialize will be called by new()
sub initialize {
my $self = shift;
$self->three(1) unless defined $self->three();
}

use Foo;
$foo = Foo->new();

# store 27 in the one attribute
$foo->one(27);

# check the value in the two attribute
die "should be undefined" if defined $foo->two();

# set using the utility method
$foo->set_attribute(one,27);

# check using the utility method
$two = $foo->get_attribute(two);

# set more than one attribute using the named parameter style
$foo->set_attributes(one=>27, two=>42);

# or using array references
$foo->set_attributes([one,two],[27,42]);

# get more than one attribute
@list = $foo->get_attributes(one, two);

# get a list of all attributes known by an object
@attrs = $foo->get_attribute_names();

# check that initialize() is called properly
die "initialize didnt set three()" unless $foo->three();

Class::ObjectTemplate is a utility class to assist in the building of other Object Oriented Perl classes.

It was described in detail in the OReilly book, "Advanced Perl Programming" by Sriram Srinivasam.

<<less
Download (0.006MB)
Added: 2006-10-05 License: Perl Artistic License Price:
1115 downloads
Class::CGI 0.20

Class::CGI 0.20


Class::CGI is a Perl module to fetch objects from your CGI object. more>>
Class::CGI is a Perl module to fetch objects from your CGI object.

SYNOPSIS

use Class::CGI
handlers => {
customer_id => My::Customer::Handler
};

my $cgi = Class::CGI->new;
my $customer = $cgi->param(customer_id);
my $name = $customer->name;
my $email = $cgi->param(email); # behaves like normal

if ( my %errors = $cgi->errors ) {
# do error handling
}

For small CGI scripts, its common to get a parameter, untaint it, pass it to an object constructor and get the object back. This module would allow one to to build Class::CGI handler classes which take the parameter value, automatically perform those steps and just return the object. Much grunt work goes away and you can get back to merely pretending to work.

<<less
Download (0.017MB)
Added: 2006-10-20 License: Perl Artistic License Price:
1099 downloads
Class::Cloneable 0.03

Class::Cloneable 0.03


Class::Cloneable is a base class for Cloneable objects. more>>
Class::Cloneable is a base class for Cloneable objects.

SYNOPSIS

package MyObject;
our @ISA = (Class::Cloneable);

# calling clone on an instance of MyObject
# will give you full deep-cloning functionality

This module provides a flexible base class for building objects with cloning capabilities. This module does its best to respect the encapsulation of all other objects, including subclasses of itself. This is intended to be a stricter and more OO-ish option than the more general purpose Clone and Clone::PP modules.

<<less
Download (0.008MB)
Added: 2006-10-06 License: Perl Artistic License Price:
1114 downloads
Class::StrongSingleton 0.02

Class::StrongSingleton 0.02


Class::StrongSingleton is a stronger and more secure Singleton base class. more>>
Class::StrongSingleton is a stronger and more secure Singleton base class.

SYNOPSIS

package My::Singleton::Class;

use base qw(Class::StrongSingleton);

sub new {
my ($class, %my_params) = @_;
# create our object instance
my $instance = { %my_params };
bless($instance, $class);
# and initialize it as a singleton
$instance->_init_StrongSingleton();
return $instance;
}

1;

# later in your code ...

# create the first instance of our class
my $instance = My::Singleton::Class->new(param => "value");

# try to create a new one again, and
# you end up with the same instance, not
# a new one
my $instance2 = My::Singleton::Class->new(param => "other value");

# calling instance returns the singleton
# instance expected
my $instance3 = My::Singleton::Class->instance();

# although rarely needed, if you have to
# you can destroy the singleton

# either through the instance
$instance->DESTROY();
# or through the class
My::Singleton::Class->DESTROY();

# of course, this is assuming you
# did not override DESTORY yourself

# Also calling instance before calling new
# will returns a new singleton instance
my $instance = My::Singleton::Class->instance();

This module is an alternative to Class::Singleton and Class::WeakSingleton, and provides a more secure Singleton class in that it takes steps to prevent the possibility of accidental creation of multiple instances and/or the overwriting of existsing Singleton instances. For a detailed comparison please see the "SEE ALSO" section.

Here is a description of how it all works. First, the user creates the first Singleton instance of the class in the normal way.

my $obj = My::Singleton::Class->new("variable", "parameter");

This instance is then stored inside a lexically scoped variable within the Class::StrongSingleton package. This prevents the variable from being accessed by anything but methods from the Class::StrongSingleton package. At this point as well, the new method to the class is overridden so that it will always return the Singleton instance. This prevents any accidental overwriting of the Singleton instance. This means that any of the follow lines of code all produce the same instance:

my $instance = $obj->instance();
my $instance = My::Singleton::Class->instance();
my $instance = $obj->new();
my $instance = My::Singleton::Class->new();

Personally, I see this an an improvement over the usual Gang of Four style Singletons which discourages the use of the new method entirely. Through this method, a user can be able to use the Singleton class in a normal way, not having to know its actually a Singleton. This can be handy if your design changes and you no longer need the class as a Singleton.

<<less
Download (0.006MB)
Added: 2007-06-19 License: Perl Artistic License Price:
858 downloads
Dynamic Probe Class Library 3.4.3

Dynamic Probe Class Library 3.4.3


Dynamic Probe Class Library (DPCL) is an object-based C++ class library. more>>
Dynamic Probe Class Library (DPCL) is an object-based C++ class library that provides the necessary infrastructure to allow tool developers and sophisticated tool users to build parallel and serial tools through technology called dynamic instrumentation.
Dynamic Probe Class Library takes the basic components needed by tool developers and encapsulates them into C++ classes. Each of these classes provide the member functions necessary to interact and dynamically instrument a running application with software patches called probes.
Dynamic instrumentation provides the flexibility for tools to insert probes into applications as the application is running and only where it is needed.
Enhancements:
- This version is a minor update to DPCL that fixes a couple problems that have been reported since the v3.4.2 release
<<less
Download (2.5MB)
Added: 2006-07-28 License: GPL (GNU General Public License) Price:
1185 downloads
Class::Std 0.0.8

Class::Std 0.0.8


Class::Std is a Perl module to support for creating standard inside-out classes. more>>
Class::Std is a Perl module to support for creating standard "inside-out" classes.

SYNOPSIS

package MyClass;
use Class::Std;

# Create storage for object attributes...
my %name : ATTR;
my %rank : ATTR;
my %snum : ATTR;

my %public_data : ATTR;

# Handle initialization of objects of this class...
sub BUILD {
my ($self, $obj_ID, $arg_ref) = @_;

$name{$obj_ID} = check_name( $arg_ref->{name} );
$rank{$obj_ID} = check_rank( $arg_ref->{rank} );
$snum{$obj_ID} = _gen_uniq_serial_num();
}

# Handle cleanup of objects of this class...
sub DEMOLISH {
my ($self, $obj_ID) = @_;

_recycle_serial_num( $snum{$obj_ID} );
}

# Handle unknown method calls...
sub AUTOMETHOD {
my ($self, $obj_ID, @other_args) = @_;

# Return any public data...
if ( m/A get_(.*)/ ) { # Method name passed in $_
my $get_what = $1;
return sub {
return $public_data{$obj_ID}{$get_what};
}
}

warn "Cant call $method_name on ", ref $self, " object";

return; # The call is declined by not returning a sub ref
}

This module provides tools that help to implement the "inside out object" class structure in a convenient and standard way.

<<less
Download (0.030MB)
Added: 2006-09-26 License: Perl Artistic License Price:
1124 downloads
Class::Interfaces 0.04

Class::Interfaces 0.04


Class::Interfaces is a Per module for defining interface classes inline. more>>
Class::Interfaces is a Per module for defining interface classes inline.

SYNOPSIS

# define some simple interfaces
use Class::Interfaces (
Serializable => [ pack, unpack ],
Printable => [ toString ],
Iterable => [ iterator ],
Iterator => [ hasNext, next ]
);

# or some more complex ones ...

# interface can also inherit from
# other interfaces using this form
use Class::Interfaces (
BiDirectionalIterator => {
isa => Iterator,
methods => [ hasPrev, prev ]
},
ResetableIterator => {
isa => Iterator,
methods => [ reset ]
},
# we even support multiple inheritance
ResetableBiDirectionalIterator => {
isa => [ ResetableIterator, BiDirectionalIterator ]
}
);

# it is also possible to create an
# empty interface, sometimes called
# a marker interface
use Class::Interfaces (
JustAMarker => undef
);

This module provides a simple means to define abstract class interfaces, which can be used to program using the concepts of interface polymorphism.

<<less
Download (0.006MB)
Added: 2006-10-05 License: Perl Artistic License Price:
1115 downloads
Class::Adapter::Builder 1.02

Class::Adapter::Builder 1.02


Class::Adapter::Builder is a Perl module that can generate Class::Adapter classes. more>>
Class::Adapter::Builder is a Perl module that can generate Class::Adapter classes.

SYNOPSIS

package My::Adapter;

use strict;
use Class::Adapter::Builder
ISA => Specific::API,
METHODS => [ qw{foo bar baz} ],
method => different_method;

1;

Class::Adapter::Builder is another mechanism for letting you create Adapter classes of your own.

It is intended to act as a toolkit for generating the guts of many varied and different types of Adapter classes.

For a simple base class you can inherit from and change a specific method, see Class::Adapter::Clear.

<<less
Download (0.024MB)
Added: 2006-10-06 License: Perl Artistic License Price:
1114 downloads
Class::AbstractLogic 0.01_01

Class::AbstractLogic 0.01_01


Class::AbstractLogic is a Perl module to handle Logic Abstractions. more>>
Class::AbstractLogic is a Perl module to handle Logic Abstractions.

SYNOPSIS

# the logic class definition
package My::Logic::Foo;
use Class::AbstractLogic-base;

# a logic action
action add,
needs [qw(a b)],
verify { a => sub { /^d+$/ }, b => sub { /^d+$/ } },
sub { $_{a} + $_{b} };

1;
...

# logic module manager creation
use Class::AbstractLogic;
my $calm = Class::AbstractLogic::Manager->new;

# loading a logic class
$calm->load_logic(Foo => My::Logic::Foo);

# requesting a result from a logic method
my $result = $calm->logic(Foo)->add(a => 11, b => 12);

# $result will be false if an exception was caught
if ($result) {
print result was . $result->value . "n";
}
else {
print exception raised: . $result->key . "n";
print error message: . $result->error . "n";
}

<<less
Download (0.016MB)
Added: 2007-08-01 License: Perl Artistic License Price:
814 downloads
Secleted [ 0 ] software to compare
  • Page: 1 of 5
  • 1
  • 2
  • 3
  • 4
  • 5