On 2004-09-10, Vitaliy Babiy <[EMAIL PROTECTED]> wrote:
> Guys, I was following this discussion for long time but now I'm confused
> a little. As far as I remember original idea of C::A::Plugin, every
> plugin should have structure like this:
>
>
>============= quote from C::A::Plugin documentation ===============
>
>   package CGI::Application::Plugin::MyPlugin
>
>   use base 'CGI::Application::Plugin';
>
>   sub method_name : CGIAppPluginMethod {
>     my $self = shift;
>     # This method is exported to the plugged-in module
>   }
>
>   sub this_method_is_not_exported {}
>
>===================================================================
>
> but all plugins currently developed use different approach using
> Exporter, like this:
>
>============= quote from C::A::Plugin::DBH code ===================
>
> package CGI::Application::Plugin::DBH;
>
> use strict;
> use vars qw($VERSION @ISA @EXPORT_OK);
> require Exporter;
> @ISA = qw(Exporter);
> @EXPORT_OK = qw(
>     dbh
>     dbh_config
> );
>
> sub dbh {
>     my $self = shift;
>
>     ...........
> }
>===================================================================
>
> Did I miss something? I mean it seems like C::A::Plugin is not
> obligatory itself for any of this plugin. Is the initial idea of
> C::A::Plugin deprecated now?

Cees and I had alternate ideas for a standard plug-in system for C::A.
As I recall, we agreed to use the simple "Exporter" style for now.
In the future we could do something a little more advanced and
abstracted like the first example above  if it seems necessary or useful. 

As you can see from the Exporter example, there is nothing special you
have to do create a plug-in. While I think just using Exporter is a good
way to do it, it's more of a recommendation than a contract.

        Mark

-- 
 . . . . . . . . . . . . . . . . . . . . . . . . . . . 
   Mark Stosberg            Principal Developer  
   [EMAIL PROTECTED]     Summersault, LLC     
   765-939-9301 ext 202     database driven websites
 . . . . . http://www.summersault.com/ . . . . . . . .


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to