![]() |
![]()
| ![]() |
![]()
NAMEIOC::Service::ConstructorInjection - An IOC Service object which uses Constructor Injection SYNOPSISuse IOC::Service::ConstructorInjection; # this will call : # FileLogger->new() # when it creates a logger # component instance my $service = IOC::Service::ConstructorInjection->new('logger' => ('FileLogger', 'new', [])); # this will call : # FileLogger->new($container->get('log_file'), "some other argument") # when it creates a logger # component instance my $service = IOC::Service::ConstructorInjection->new('logger' => ( 'FileLogger', 'new', [ IOC::Service::ConstructorInjection->ComponentParameter('log_file'), "some other argument" ])); # this will call : # FileLogger->new($container->find('/files/log_file'), "some other argument") # when it creates a logger # component instance my $service = IOC::Service::ConstructorInjection->new('logger' => ( 'FileLogger', 'new', [ IOC::Service::ConstructorInjection->ComponentParameter('/files/log_file'), "some other argument" ])); DESCRIPTIONIn this IOC framework, the IOC::Service::ConstructorInjection object holds instances of components to be managed. +--------------+ | IOC::Service | +--------------+ | ^ | +------------------------------------+ | IOC::Service::ConstructorInjection | +------------------------------------+ METHODS
CLASS 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 ALSO
AUTHORstevan 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.
|