package MyClass; use DBIx::SearchBuilder::Record::Cachable; @ISA = (DBIx::SearchBuilder::Record::Cachable); # Object initialize method sub _Init { my $self = shift; my $DBIxHandle = shift; # A DBIx::SearchBuilder::Handle object f +or your database $self->_Handle($DBIxHandle); $self->Table("YourTable"); # Do some object initialization } # Object properties and access modes sub _Accessible { my $self = shift; my %Cols = ( Name => 'read/write/admin', Password => 'read/write/admin', + Comments => 'read/write', Signature => 'read/write', ); return($self->SUPER::_Accessible(@_, %Cols)); . . .
Thise set of modules allowes you to develop an abstact interface between your classes and database and spares you from routine things (like create a constuctor, object properties access methods etc).
I hope that it will be useful for you :-)
--------------------------------
SV* sv_bless(SV* sv, HV* stash);
In reply to Re: Writing Better Objects
by nite_man
in thread Writing Better Objects
by Angel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |