I would allow the user to specify or pass the delegating classes or objects in the constructor for C. Basically, I'd change the interface to
my $c = C::Enhanced->new( c1 => C1::Enhanced->new(), c2 => 'C::C2::Better', # will implicitly call C::C2::Better->new() );
It seems to me that C only specifies the workflow while C1, C2 etc. supply the worker implementation. I really wouldn't want to write new C classes just to change the implementation of the workers when the workflow itself remains the same. I would want to be able to load such a workflow configuration from a configuration file, which to me means that it should be specified as parameters to C, not as subclasses of C.
In reply to Re: Test bed example: How to acheive plug-in for complex object?
by Corion
in thread Test bed example: How to acheive plug-in for complex object?
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |