in reply to XML Resume Module design
Just replace Base with Resume and Foo and Bar with XML, HTML, PDF or whatever. Check out http://www.patternsinperl.com/designpatterns/factorymethod for a good read also.package Factory; sub create { my $class = shift; my $obj = 'Base::' . shift; return $obj->new(); } package Base; sub output { my $self = shift; return $self->{thing}; } package Base::Foo; use base 'Base'; sub new { my $class = shift; my $self = { thing => 'foo' }; return bless $self,$class; } package Base::Bar; use base 'Base'; sub new { my $class = shift; my $self = { thing => 'bar' }; return bless $self,$class; } package main; my @things = ( Factory->create('Foo'), Factory->create('Bar'), ); print $_->output,$/ for @things;
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: (jeffa) XML Resume Module design
by Anonymous Monk on Jul 26, 2002 at 14:58 UTC | |
by jeffa (Bishop) on Jul 26, 2002 at 15:27 UTC | |
by agentv (Friar) on Jul 26, 2002 at 17:42 UTC | |
by Smylers (Pilgrim) on Jul 26, 2002 at 15:01 UTC |