| 1 | package XAS::Factory; | ||
| 2 | |||
| 3 | our $VERSION = '0.01'; | ||
| 4 | |||
| 5 | use Badger::Factory::Class | ||
| 6 | debug => 0, | ||
| 7 | version => $VERSION, | ||
| 8 | item => 'module', | ||
| 9 | path => 'XAS::Lib XAS::Lib::Modules', | ||
| 10 | modules => { | ||
| 11 | alert => 'XAS::Lib::Modules::Alerts', | ||
| 12 | email => 'XAS::Lib::Modules::Email', | ||
| 13 | environment => 'XAS::Lib::Modules::Environment', | ||
| 14 | log => 'XAS::Lib::Modules::Log', | ||
| 15 | logger => 'XAS::Lib::Modules::Log', | ||
| 16 | locking => 'XAS::Lib::Modules::Locking', | ||
| 17 | lockmgr => 'XAS::Lib::Modules::Locking', | ||
| 18 | spool => 'XAS::Lib::Modules::Spool', | ||
| 19 | spooler => 'XAS::Lib::Modules::Spool', | ||
| 20 | } | ||
| 21 | ; | ||
| 22 | |||
| 23 | 1; | ||
| 24 | |||
| 25 | __END__ | ||
| 26 | |||
| 27 | =head1 NAME | ||
| 28 | |||
| 29 | XAS::Factory - A factory system for the XAS environment | ||
| 30 | |||
| 31 | =head1 SYNOPSIS | ||
| 32 | |||
| 33 | You can use this module in the following manner. | ||
| 34 | |||
| 35 | use XAS::Factory; | ||
| 36 | |||
| 37 | my $env = XAS::Factory->module('environment'); | ||
| 38 | |||
| 39 | ... or ... | ||
| 40 | |||
| 41 | my $env = XAS:Factory->module('Environment'); | ||
| 42 | |||
| 43 | Either of the above statements will load the XAS::Lib::Modules::Environment module. | ||
| 44 | |||
| 45 | =head1 DESCRIPTION | ||
| 46 | |||
| 47 | This module is a factory system for the XAS environment. It will load and | ||
| 48 | initialize modules on demand. The advantage is that you don't need to load | ||
| 49 | all your modules at the beginning of your program. You also don't need to | ||
| 50 | know where individual modules live. And this system can provide nice alias | ||
| 51 | for long module names. This should lead to cleaner more readable programs. | ||
| 52 | |||
| 53 | =head1 MODULES | ||
| 54 | |||
| 55 | The following modules have been defined. | ||
| 56 | |||
| 57 | =over 4 | ||
| 58 | |||
| 59 | =item B<alert> | ||
| 60 | |||
| 61 | This will load L<XAS::Lib::Modules::Alerts|XAS::Lib::Modules::Alerts>. | ||
| 62 | |||
| 63 | =item B<email> | ||
| 64 | |||
| 65 | This will load L<XAS::Lib::Modules::Email|XAS::Lib::Modules::Email>. | ||
| 66 | |||
| 67 | =item B<environment> | ||
| 68 | |||
| 69 | This will load L<XAS::Lib::Modules::Environment|XAS::Lib::Modules::Environment> | ||
| 70 | |||
| 71 | =item B<log logger> | ||
| 72 | |||
| 73 | This will load L<XAS::Lib::Modules::Log|XAS::Lib::Modules::Log> | ||
| 74 | |||
| 75 | =item B<locking lockmgr> | ||
| 76 | |||
| 77 | This will load L<XAS::Lib::Modules::Locking|XAS::Lib::Modules::Locking>. | ||
| 78 | |||
| 79 | =item B<spool spooler> | ||
| 80 | |||
| 81 | This will load L<XAS::Lib::Modules::Spool|XAS::Lib::Modules::Spool>. | ||
| 82 | |||
| 83 | =back | ||
| 84 | |||
| 85 | =head1 METHODS | ||
| 86 | |||
| 87 | =head2 module | ||
| 88 | |||
| 89 | This method loads the named module and passes any parameters to that module. | ||
| 90 | |||
| 91 | =head1 SEE ALSO | ||
| 92 | |||
| 93 | =over 4 | ||
| 94 | |||
| 95 | =item L<XAS|XAS> | ||
| 96 | |||
| 97 | =back | ||
| 98 | |||
| 99 | =head1 AUTHOR | ||
| 100 | |||
| 101 | Kevin L. Esteb, E<lt>kevin@kesteb.usE<gt> | ||
| 102 | |||
| 103 | =head1 COPYRIGHT AND LICENSE | ||
| 104 | |||
| 105 | Copyright (C) 2014 Kevin L. Esteb | ||
| 106 | |||
| 107 | This library is free software; you can redistribute it and/or modify | ||
| 108 | it under the same terms as Perl itself, either Perl version 5.8.8 or, | ||
| 109 | at your option, any later version of Perl 5 you may have available. | ||
| 110 | |||
| 111 | See L<http://dev.perl.org/licenses/> for more information. | ||
| 112 | |||
| 113 | =cut |