Are you saying that Server and Client each want a different derived class of the Connection, but the Connection may already be different concrete classes?I'm not sure if I understand you here correctly: The basic idea is to have 2 interchangeable ways of providing "remote access" functionality to the Server and Client objects. The application will then do something like:
Where in this example "run" is defined in the Role and implemented by SSH and Socket.my $server = Server->new(type => "ssh"); # to create an SSH connection $server->run("ifconfig"); my $server2 = Server->new(type => "socket"); # to create a socket conn +ection $server2->run("ifconfig"); my $client = Client->new(type => "ssh"); $client->run("ls");
In reply to Re^2: Inherit from a Role (or something like that)
by elTriberium
in thread Inherit from a Role (or something like that)
by elTriberium
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |