swiftone has asked for the wisdom of the Perl Monks concerning the following question:
My question is: What is the best way to go about it?
My current thought is that my program will go something like this:
So will this work? What are the problems involved in using require rather than use? Is there a more standard way to have an interface layer? Perhaps with a standard Interface package, and you specify modules for it to use, much like DBI provides a standard interface to DBD modules?$interface=""; #$interface can be read from a config file require $interface; #Can't use use because it isn't known at compile t +ime $object=new $interface; #symbolic reference to the interface package #fiddle with my data. $object->update_screen(); #one form of output $item=$object->item(); #creates a sub element $item->update(); #another form of output
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Adding interface layers
by btrott (Parson) on May 24, 2000 at 19:30 UTC | |
by swiftone (Curate) on May 24, 2000 at 19:36 UTC |