NAME

Bread::Board::LazyLoader::Site - loads tree of IOC files alongside pm file

VERSION

version 0.14

SYNOPSIS

In module dir we have files, each one containing the definition of one Bread::Board::Container

    lib/My/Site/Supp/Database.ioc
    lib/My/Site/Root.ioc
    lib/My/Site/Config.ioc
    lib/My/Site/Database.ioc
    lib/My/Site/Planner.ioc
    lib/My/Site/AQ.ioc

the "site" module lib/My/Site.pm is defined like

    package My::Site;
    use strict;
    use warnings;

    use Bread::Board::LazyLoader::Site;

    1;

in the script

    use My::Site;

    my $root = My::Site->root;
    my $db_container = $root->fetch('Database');
    my $dbh = $root->resolve(service => 'Database/dbh');

DESCRIPTION

Site module is a module with a class method root returning an instance of Bread::Board::Container.

Bread::Board::LazyLoader::Site just imports such root method.

import parameters

   use Bread::Board::LazyLoader::Site %params;
dir

Directory searched for container files. By default it is the directory with the same name as module file without suffix.

suffix

Suffix of container files. By default ioc.

base

Another site module. All container files are loaded on top of the base file containers.

AUTHOR

Roman Daniel <roman@daniel.cz>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Roman Daniel.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.