This repository has been archived by the owner on Aug 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
74 lines (49 loc) · 2.04 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Kaiten-Container
This module resolve dependency injection conception in easiest way ever.
You are just create some code first and put it on kaiten in named
container. Later you take it by name and got yours code result fresh and
crispy.
No more humongous multi-level dependency configuration, service provider
and etc.
You got what you put on, no more, no less.
Ok, little bit more - Kaiten::Container run |probe| sub every time when you want to take
something to ensure all working properly.
And another one - KC try to re-use |handler| return if it requested.
use Kaiten::Container;
my $config = {
ExampleP => {
handler => sub { return DBI->connect( "dbi:ExampleP:", "", "", { RaiseError => 1 } ) or die $DBI::errstr },
probe => sub { shift->ping() },
settings => { reusable => 1 }
}
};
my $container = Kaiten::Container->new( init => $config );
my $dbh = $container->get_by_name('ExampleP');
All done, now we are have container and may get DB handler on call.
Simple!
Ah, deep dependencies worked, see documentation.
INSTALLATION
To install this module, run the following commands:
perl Build.PL
./Build
./Build test
./Build install
SUPPORT AND DOCUMENTATION
After installing, you can find documentation for this module with the
perldoc command.
perldoc Kaiten::Container
You can also look for information at:
RT, CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Kaiten-Container
AnnoCPAN, Annotated CPAN documentation
http://annocpan.org/dist/Kaiten-Container
CPAN Ratings
http://cpanratings.perl.org/d/Kaiten-Container
Search CPAN
http://search.cpan.org/dist/Kaiten-Container/
LICENSE AND COPYRIGHT
Copyright (C) 2011 Meettya
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.