Class::Interfaces 0.04 review

Download
by rbytes.net on

License: Perl Artistic License
File size: 6K
Developer: Stevan Little
0 stars award from rbytes.net

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.

Requirements:
Perl

Class::Interfaces 0.04 search tags