参照 Perl

■ classの受け方
my $wantclass = ref($_[0]) || $_[0];

■ 引数として{A => 'B'}を受け取る時のチェック
$param_ref = undef unless (ref $param_ref eq 'HASH');

■ 引数ハッシュチェック(これでもいいかも)
die('not enough parameters (Album::DBI::AubumProductDAO::findAlbumProduct)')
unless  (exists $bind_params->{user_id} );

■ newの書き方(無駄のない美しい)
sub foo { my $self = shift; @_ ? $self->{foo} = shift : $self->{foo} }

Goyaで学ぶDIベースのシステム設計

■ Table : Entity = 1:1
テーブル名は基本複数形にしておいたほうが、後々良い(と思ふ)

■ classの受け方
my $wantclass = ref($_[0]) || $_[0];

■ 引数として{A => 'B'}を受け取る時のチェック
$param_ref = undef unless (ref $param_ref eq 'HASH');

■ 引数ハッシュチェック(これでもいいかも)
die('not enough parameters (Album::DBI::AubumProductDAO::findAlbumProduct)')
unless  (exists $bind_params->{user_id} );

■ newの書き方(無駄のない美しい)
sub foo { my $self = shift; @_ ? $self->{foo} = shift : $self->{foo} }

Goyaで学ぶDIベースのシステム設計

■ Table : Entity = 1:1
テーブル名は基本複数形にしておいたほうが、後々良い(と思ふ)