wrote:
> I have a question either about OO in general, or its implementation in
> Perl--I'm not sure which because I don't know enough.
>
> I've created the module Net::Browser::InternetExplorer. It drives an
> IE instance.
>
> I want to eventually create modules for driving other browsers--like
> Net::Browser::FireFox . I would like to be able to say, therefore:
>
> my $browser = Net::Browser->new( flavor => 'InternetExplorer', $URL );
>
> or
>
> my $browser = Net::Browser->new( flavor => 'FireFox', $URL );
Or
my $browser = Net::Browser::Firefox( $url );
my $browser = Net::Browser::InternetExplorer( $url );
Is there a reason why you want to pass it as a parameter? If so, it
sounds like you want to do something with plug ins, e.g.
Otherwise, in the new of Net::Browser you try to use
Net::Browser::YourBrowser, if ok, you call new, and return the instance.
> know which OO concept or catchphrase I should be looking for!
Factory:
<http://www.vico.org/pages/PatronsDisseny/Pattern%20Abstract%20Factory/>
<http://www.pasteur.fr/formation/infobio/python/ch18s06.html>
--
John Small Perl scripts:
http://johnbokma.com/perl/
Perl programmer available:
http://castleamber.com/
Happy Customers:
http://castleamber.com/testimonials.html