[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] ANNOUNCE: ::Plugin::ValidateRM 2.00_01 with new dfv() method


Mark Stosberg wrote:
> Hello,
> 
> I've just uploaded a new developer release of ValidateRM to CPAN, which
> you can also get here:
> 
>  http://mark.stosberg.com/dfv/CGI-Application-Plugin-ValidateRM-2.00_01.tar.gz
> 
> I added a dfv() method as an alternate way to access the results object
> that's generated. I think this will be of primary interest to other
> plugin authors rather than users.

Nice! Since there is now a better way to access the results how about
making the return from check_rm cleaner too? Would you consider allowing

  my $error_page = $self->check_rm(...);

It would just have to check wantarray() to DTRT in scalar context. This
would simplify things a lot IMHO. And it would still be backwards
compatible.

> For example, AnyTemplate could use it to automatically make the
> validated data available as template parameters. 
> 
> I made it a developer release, because I'm hung up on the best way to
> handle an export/import issue. 
> 
> I now ask users to explicitly export check_rm(). (A choice which I have
> come to care less about.)
> 
> However, I wanted dfv() to be exported automatically, thinking that
> users won't need to see it, but it would be available to other plugin
> authors. 

I agree, it's such a common thing that I think other plugins will want
it too.

> I learned that I can't mix implicit and explicit imports like that,
> without writing my own import() routine. But adding that
> non-standardness might further confuse people.
> 
> I chose to have people import dfv() explicitly if they want it for now,
> but am open to other suggestions about this, or any other feedback at
> all.

I think you should just export both methods. It's only 2 and anyone who
uses the plugin should know what they're getting. Allowing the user to
choose which methods they import is nice when the package provides a lot
so that your namespace isn't cluttered with stuff you're not going to
use. However, I can't see someone using this module without using those
methods.

> Thumbs up? Thumbs down? 

Up, way up!

-- 
Michael Peters
Developer
Plus Three, LP


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


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.