Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: OO: Building an object of the right type based on a parameter

by mstone (Deacon)
on Mar 14, 2004 at 04:32 UTC ( [id://336454]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        package ClientFactory;
        
    ...
        
        my $client = ClientFactory::genericClient();
        my $calculator = $client->getCalculator();
    
  2. or download this
        package Storage;
        
    ...
        my $client = new Client;
        my $calc = $client->getCalculator();
        $calc->calculate();
    
  3. or download this
        sub InvoiceCalculator::calculate {
            my $O = shift;
    ...
            }
            return;
        }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://336454]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-03-29 06:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found