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

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


Thanks for the feedback Michael. Comments below. 

On 2005-07-12, Michael Peters <suppressed> wrote:
> 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.


I'm not included to do this. Here's why. 

  # What's going on here? These statements don't seem related
  # ... unless I go read some documentation. 
  my $error_page = $self->check_rm(...);
  $self->dfv->valid('email');

  # Oh, now I see the connection. 
  my ($results,$error_page) = $self->check_rm(...);
  $results->valid('email');

Passing data around in through the object is one step away from the
evilness of global variables. 

Explicit parameter passing is easier to debug and less error prone in my
opinion. 

    Mark

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


---------------------------------------------------------------------
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.