ML functor wouldn't help either, because parameter I is insufficient to determine which of A B C is indicated. So I will assume you mean that the implementation also needs to be indicated in the call. But we still need to know what are the criteria for choosing which implementation. Example of parameter driven calling however:
package Action;
use Moo;
has interface => (is => 'ro');
has implementation => (is => 'ro');
our %action =
(IA => sub {&intIimpA;},
IB => sub {&intIimpB;},
IC => sub {&intIimpC;},
);
sub doAction {
my $self = shift;
&{$action{$self->interface . $self->implementation}};
}
#
sub intIimpA{
# implementation code in here
}
sub intIimpB{
}
sub intIimpC{
}
1;