Categories: None [Edit]
pluginfactory
PluginFactory is a mixin module that turns an including class into a factory for
its derivatives, capable of searching for and loading them by name. This is
useful when you have an abstract base class which defines an interface and basic
functionality for a part of a larger system, and a collection of subclasses
which implement the interface for different underlying functionality.
An example of where this might be useful is in a program which talks to a
database. To avoid coupling it to a specific database, you use a Driver class
which encapsulates your program's interaction with the database behind a useful
interface. Now you can create a concrete implementation of the Driver class for
each kind of database you wish to talk to. If you make the base Driver class a
PluginFactory, too, you can add new drivers simply by dropping them in a
directory and using the Driver's `create` method to instantiate them:
Total
Ranking: 13,582 of 183,107
Downloads: 134,122
Daily
Ranking: 53,556 of 183,092
Downloads: 1
Downloads Trends
Ranking Trends
Num of Versions Trends
Popular Versions (Major)
Popular Versions (Major.Minor)
Depended by
Rank | Downloads | Name |
---|---|---|
17,610 | 85,929 | rehabilitate |
39,739 | 27,305 | arrow |
Depends on
Rank | Downloads | Name |
---|---|---|
210 | 167,990,555 | rdoc |
2,086 | 8,574,300 | hoe |
21,404 | 63,740 | hoe-deveiate |
22,685 | 58,649 | hoe-mercurial |
22,685 | 58,649 | hoe-mercurial |
30,002 | 39,508 | hoe-highline |