[SearchBuilder-devel] [RFC] Jifty-DBI API changes
Jesse Vincent
jesse at bestpractical.com
Sat Sep 17 00:24:41 EDT 2005
On Sat, Sep 17, 2005 at 08:17:11AM +0400, Ruslan Zakirov wrote:
> Hello.
> 1) _init methods in Collection and Record classes:
> * Collection.pm
> sub _init {
> my $self = shift;
> my %args = (
> handle => undef,
> @_
> );
> $self->_handle( $args{'handle'} );
> ...
> * Record.pm
> sub _init {
> my $self = shift;
> my $handle = shift;
> $self->_handle($handle);
> ...
> I hope you see the difference
Yes, and it's been giving us trouble here. We do want to change it.
Probably to switching to always using named parameters.
> 2) I don't understand why _handle is a private method. yes, in most
> cases I don't want to override this, but I do want get handle use it
> and don't be afraid that I'm doing something wrong.
Yeah, I'd be happy to promote it up to a public method
>
> 3) Named arguments vs arrays. Named arguments have much benefits over
> arrays, but sometimes you need array or in many cases only one
> argument for example $record->set_mycolumn('foo') or
> $r->handle($jdbi_handle). Framework should be strict on the subject
> and it must be documented in one place. all methods should be splitted
> into virtual groups by which style of argument handling they use.
If you're ever doing more than one argument, I think it probably makes
sense to do named_params. I think.
> ... to be continued
>
>
>
> --
> Best regards, Ruslan.
> _______________________________________________
> SearchBuilder-devel mailing list
> SearchBuilder-devel at bestpractical.com
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/searchbuilder-devel
>
--
More information about the SearchBuilder-devel
mailing list