|
NAMEIOC::Service - An IOC Service object SYNOPSIS use IOC::Service;
my $container = IOC::Container->new();
$container->register(IOC::Service::Literal->new('log_file' => "logfile.log"));
$container->register(IOC::Service->new('logger' => sub {
my $c = shift;
return FileLogger->new($c->get('log_file'));
}));
$container->register(IOC::Service->new('application' => sub {
my $c = shift;
my $app = Application->new();
$app->logger($c->get('logger'));
return $app;
}));
$container->get('application')->run();
DESCRIPTIONIn this IOC framework, the IOC::Service object holds instances of components to be managed. +--------------+ +-------------------------+
| IOC::Service |---(instance)--->| <Your Component/Object> |
+--------------+ +-------------------------+
|
(parent_container)
|
V
+------------------+
| IOC::Container |
+------------------+
METHODS
TO DOBUGSNone that I am aware of. Of course, if you find a bug, let me know, and I will be sure to fix it. CODE COVERAGEI use Devel::Cover to test the code coverage of my tests, see the CODE COVERAGE section of IOC for more information. SEE ALSOAUTHORstevan little, <stevan@iinteractive.com> COPYRIGHT AND LICENSECopyright 2004-2007 by Infinity Interactive, Inc. <http://www.iinteractive.com> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|