Class::Container

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

Class::Container Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Ken Williams
  • Publisher web site:
  • http://search.cpan.org/~kwilliams/Module-Build-0.2808/lib/Module/Build/Compat.pm

Class::Container Tags


Class::Container Description

Class::Container is a Perl module with Glues object frameworks together transparently. 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 frameworkTransparent passing of constructor parameters to the class that needs themAbility to create one (automatic) or many (manual) contained objects automatically and transparently Requirements: · Perl


Class::Container Related Software