It's reasonable to provide static methods in a Factory class that will let you register new classes by name. For example, see the Class::Factory module on CPAN. Then you can provide access to classes that are in files outside of your main file, and you don't have to expose a global variable.
In reply to Re: Object factories
by tall_man
in thread Object factories
by dragonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |