in reply to Re^2: OO, Library Configuration and Class Variables
in thread OO, Library Configuration and Class Variables
I don't think it would break your model to have the user request the type of source from a config file. It's actually still not even necessary to do that, as it could select from a pre-created list of Lookup Sources.package LookupFactory; use base qw( UserSource ); sub init_lookup { # run config based upon type of source requested } package UserSource; sub get { # get the type of user source (lookup, database, whatever) } package User sub new { # get a source based upon whatever the User config says to get } package App $user = User->new(); $user->info() # look ma! no config!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: OO, Library Configuration and Class Variables
by moot (Chaplain) on Jun 23, 2005 at 22:37 UTC | |
by izut (Chaplain) on Jun 23, 2005 at 23:25 UTC | |
by Transient (Hermit) on Jun 24, 2005 at 13:29 UTC | |
by moot (Chaplain) on Jun 24, 2005 at 13:52 UTC |