1Algorithm::Dependency::USsoeurrcCeo(n3t)ributed Perl DocAulmgeonrtiatthimo:n:Dependency::Source(3)
2
3
4

NAME

6       Algorithm::Dependency::Source - Implements a source of heirachy items
7

DESCRIPTION

9       The Algorithm::Dependency::Source class provides an abstract parent
10       class for implementing sources for the heirachy data the algorithm will
11       use. For an example of an implementation of this, see Algorithm::Depen‐
12       dency::Source::File, which is bundled with the main Algorithm::Depen‐
13       dency package.
14

METHODS

16       new @arguments
17
18       Although you cannot directly use the "new" constructor for "Algo‐
19       rithm::Dependency::Source", it will work the same in all subclasses.
20
21       The constructor takes zero or more subclass specific arguments to
22       define the location of the source of the items, and returns a new
23       object. Alrough it may check that the arguments you passed are valid,
24       the source will usually NOT actually load the items from the source,
25       instead defering the loading until you need to use the items.
26
27       Returns a new object on success, or "undef" on error.
28
29       load
30
31       The "load" method is the public method used to actually load the items
32       from their storage location into the the source object. The method will
33       automatically called, as needed, in most circumstances. You would gen‐
34       erally only want to use "load" manually if you think there may be some
35       uncertainty that the source will load correctly, and want to check it
36       will work.
37
38       Returns true if the items are loaded successfully, or "undef" on error.
39
40       item $name
41
42       The "item" method fetches and returns the item object specified by the
43       name argument.
44
45       Returns an Algorithm::Dependency::Item object on success, or "undef" if
46       the named item does not exist in the source.
47
48       items
49
50       The "items" method returns, as a list of objects, all of the items con‐
51       tained in the source. The item objects will be returned in the same
52       order as that in the storage location.
53
54       Returns a list of Algorithm::Dependency::Item objects on success, or
55       "undef" on error.
56
57       missing_dependencies
58
59       By default, we are leniant with missing dependencies if the item is
60       neved used. For systems where having a missing dependency can be very
61       bad, the "missing_dependencies" method checks all Items to make sure
62       their dependencies exist.
63
64       If there are any missing dependencies, returns a reference to an array
65       of their ids. If there are no missing dependencies, returns 0. Returns
66       "undef" on error.
67

EXTENDING

69       "Algorithm::Dependency::Source" itself is a fairly thin module, and it
70       is intended that you will probably need to extend it to be able to
71       extract item data from whatever location you have stored them.
72
73       This is usually a fairly simple two step process.
74
75       Overload the "new" method.
76           Assuming your subclass takes some form or argument on creation, you
77           will need to overload the "new" method to accept the arguments,
78           validate them, and store them in the source object.
79
80       Define the method "_load_item_list".
81           Leaving our parent's "load" method to take care of conflict,
82           errors, and whatever, the "_load_item_list" method is used to sim‐
83           ply create a list of Algorithm::Dependency::Item objects from wher‐
84           ever you store the item, and return them as a list.
85
86       Having completed these two things, your subclass should be completed.
87       For an example of the code, have a look at the source for the simple
88       subclass Algorithm::Dependency::Source::File.
89

SUPPORT

91       For general comments, contact the author.
92
93       To file a bug against this module, in a way you can keep track of, see
94       the CPAN bug tracking system.
95
96       <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Algorithm-Dependency>
97

AUTHOR

99       Adam Kennedy <adamk@cpan.org>, <http://ali.as/>
100

SEE ALSO

102       Algorithm::Dependency, Algorithm::Dependency::Source::File
103
105       Copyright (c) 2003 - 2005 Adam Kennedy.
106
107       This program is free software; you can redistribute it and/or modify it
108       under the same terms as Perl itself.
109
110       The full text of the license can be found in the LICENSE file included
111       with this module.
112
113
114
115perl v5.8.8                       2008-01-14  Algorithm::Dependency::Source(3)
Impressum