GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  IOC::CONFIG::XML (3)

.ds Aq ’

NAME

IOC::Config::XML - An XML Config reader for IOC

CONTENTS

SYNOPSIS



  use IOC::Config::XML;
 
  my $conf_reader = IOC::Config::XML->new();
  $conf_reader->read(my_ioc_conf.xml);
 
  # now the IOC::Registry singleton is all configured



DESCRIPTION

This is the second version of an XML configuration module for IOC. The first version used XML::Simple, which is a great module, but not really the best fit for this. I have now ported this over to use XML::SAX, which is much more flexible solution (not to mention a really nice way to interact with XML). I consider this module to be late-BETA quality (it is currently in production and working without issue for a month now).

SAMPLE XML CONF



    E<lt>RegistryE<gt>
        E<lt>Container name=ApplicationE<gt>
            E<lt>Container name=DatabaseE<gt>     
                E<lt>Service name=dsn      type=LiteralE<gt>dbi:Mock:E<lt>/ServiceE<gt>           
                E<lt>Service name=username type=LiteralE<gt>userE<lt>/ServiceE<gt>           
                E<lt>Service name=password type=LiteralE<gt>****E<lt>/ServiceE<gt>                                   
                E<lt>Service name=connection type=ConstructorInjection prototype=trueE<gt>
                    E<lt>Class name=DBI constructor=connect /E<gt>
                    E<lt>Parameter type=componentE<gt>dsnE<lt>/ParameterE<gt>               
                    E<lt>Parameter type=componentE<gt>usernameE<lt>/ParameterE<gt>
                    E<lt>Parameter type=componentE<gt>passwordE<lt>/ParameterE<gt>                           
                E<lt>/ServiceE<gt>
            E<lt>/ContainerE<gt>    
            E<lt>Service name=logger_table type=LiteralE<gt>tbl_logE<lt>/ServiceE<gt>              
            E<lt>Service name=logger type=SetterInjectionE<gt>
                E<lt>Class name=My::DB::Logger constructor=new /E<gt>
                E<lt>Setter name=setDBIConnectionE<gt>/Database/connectionE<lt>/SetterE<gt>
                E<lt>Setter name=setDBTableNameE<gt>logger_tableE<lt>/SetterE<gt>           
            E<lt>/ServiceE<gt>
            E<lt>Service name=template_factory type=ConstructorInjectionE<gt>
                E<lt>Class name=My::Template::Factory constructor=new /E<gt>
                E<lt>Parameter type=perlE<gt>[ path =E<gt> test ]E<lt>/ParameterE<gt>                         
            E<lt>/ServiceE<gt>
            E<lt>Service name=appE<gt>
                E<lt>![CDATA[
                    my $c = shift;
                    my $app = My::Application-E<gt>new();
                    $app-E<gt>setLogger($c-E<gt>get(logger));
                    return $app;
                ]]E<gt>
            E<lt>/ServiceE<gt>          
        E<lt>/ContainerE<gt>
    E<lt>/RegistryE<gt>



METHODS

<B>newB> Create a new XML::Config::XML object to read a configuration and intialize the IOC::Registry.
<B>read ($source)B> Given an XML $source file or string, this will read the XML in it and intialize the IOC::Registry singleton.

TO DO

Handle Includes I thought this will be implemented when I moved to XML::SAX, but it didn’t. I am thinking I will try to handle this on my own instead of trying to use XML tricks
Handle Aliasing This is a minor feature of IOC::Registry, but I want to support it in here eventually. It shouldn’t be a problem really, just don’t currently have a need to get it in place.
Handle IOC::Proxy objects It would be nice if you could configure IOC::Proxy objects through XML as well.

BUGS

None that I am aware of. Of course, if you find a bug, let me know, and I will be sure to fix it.

CODE COVERAGE

I use <B>Devel::CoverB> to test the code coverage of my tests, see the CODE COVERAGE section of IOC for more information.

SEE ALSO

XML::SAX
XML::SAX::ParserFactory

AUTHOR

stevan little, <stevan@iinteractive.com>

COPYRIGHT AND LICENSE

Copyright 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.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 IOC::CONFIG::XML (3) 2007-04-22

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.