1Module::Starter::PluginU(s3e)r Contributed Perl DocumentaMtoidounle::Starter::Plugin(3)
2
3
4
6 Module::Starter::Plugin -- how Module::Starter plugins work
7
9 This document is a guide to writing plugins for Module::Starter. Cur‐
10 rently, as is evident, it isn't very comprehensive. It should provide
11 enough information for writing effective plugins, though. After all,
12 Module::Starter's guts are nice and simple.
13
14 "Module::Starter->import"
15
16 Module::Starter provides an import method, the arguments to which are
17 plugins, in the order in which they should be loaded. If no plugins
18 are given, Module::Starter::Simple (and only Module::Starter::Simple)
19 is loaded.
20
21 By default, the given modules are required and arranged in an is-a
22 chain. That is, Module::Starter subclasses the last plugin given,
23 which subclasses the second-to-last, up to the first plugin given,
24 which is the base class. If a plugin provides a "load_plugins" method,
25 however, the remaining plugins to be loaded are passed to that method,
26 which is responsible for loading the rest of the plugins.
27
28 This architecture suggests two kinds of plugins:
29
30 engine plugins
31
32 An engine is a plugin that stands alone, implementing the public "cre‐
33 ate_distro" method and all the functionality required to carry out that
34 implementation. The only engine included with Module::Starter is Mod‐
35 ule::Starter::Simple, and I'm not sure any more will be seen in the
36 wild any time soon.
37
38 plain old plugins
39
40 Other plugins are designed to subclass an engine and alter its behav‐
41 ior, just as a normal subclass alters its parent class's. These plug‐
42 ins may add features to Module::Starter engines, or may just provide
43 general APIs for other plugins to exploit (like Module::Starter::Plug‐
44 in::Template.)
45
46 The template plugin is a simple example of a plugin that alters an
47 engine to accept further plugins. Other plugins like template will
48 probably be written in the near future, and plugins that exploit the
49 API provided by Module::Starter::Plugin::Template will be available on
50 the CPAN.
51
53 Ricardo SIGNES "<rjbs at cpan.org>"
54
56 Copyright 2005, Ricardo SIGNES. All Rights Reserved.
57
58 This program is free software; you can redistribute it and/or modify it
59 under the same terms as Perl itself.
60
61
62
63perl v5.8.8 2005-11-09 Module::Starter::Plugin(3)