Plugin(3pm) | User Contributed Perl Documentation | Plugin(3pm) |
Class::DBI::Plugin - Abstract base class for Class::DBI plugins
use base 'Class::DBI::Plugin'; sub init { my $class = shift; $class->set_sql( statement_name => ... ); $class->add_trigger( ... ); $class->columns( TEMP => ... ); } sub method_name : Plugged { my $class = shift; $class->sql_statement_name( ... ); } sub this_method_is_not_exported {}
Class::DBI::Plugin is an abstract base class for Class::DBI plugins. Its purpose is to make writing plugins easier. Writers of plugins should be able to concentrate on the functionality their module provides, instead of having to deal with the symbol table hackery involved when writing a plugin module. Only three things must be remembered:
So far this module only "sees" methods in the plugin module itself. If there is a class between the base class and the plugin class in the inheritance hierarchy, methods of this class will not be found. In other words, inherited methods will not be found. If requested, I will implement this behaviour.
It may be useful for plugin users to be able to choose only the plugin methods they are interested in, if there are more than one. This is not implemented yet.
Jean-Christophe Zeus, <mail@jczeus.com> with some help from Simon Cozens. Many thanks to Mark Addison for the idea with the init() method, and many thanks to Steven Quinney for the idea with the subroutine attributes.
Copyright (C) 2004 by Jean-Christophe Zeus
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2021-01-06 | perl v5.32.0 |