in reply to Test bed example: How to acheive plug-in for complex object?
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Test bed example: How to acheive plug-in for complex object?
by John M. Dlugosz (Monsignor) on May 02, 2011 at 01:22 UTC |