[Dbix-class] Emulating CDBI "temp" columns

Christopher H. Laco claco at chrislaco.com
Fri Jul 21 16:45:23 CEST 2006


Drew Taylor wrote:
> Hi,
> We just switched from CDBI to DBIC (.06999_07) for a webapp project
> and I have a couple questions:
> 
> 1) For one of the classes, I want the equivalent of CDBI's TEMP
> columns or some other sort of bucket to place temporary data that will
> never hit the database. I see that DBIx::Class uses
> Class::Data::Accessor - but it appears to be class (not
> object)-oriented.


Class::Data::Accessor is one of those couldn't-find-a-better-name
modules; compound with the fact that we have way too many disparate
accessor type modules on CPAN.

It is indeed class AND object aware. Set at the class level, object
level inherits from class, and set object level on it's own if you wish.
It is literally the same as Class::Data::Inheritable, but it's also
object aware.

  __PACKAGE__->mk_classaccessors(qw/foo bar baz/);


I would also recommend looking at Class::Accessor::Grouped. It allows
you to create grouped simple (class data) or inherited (like C::D::A)
accessor data.

  __PACKAGE__->mk_group_accessors('inherited', qw/foo bar baz/);


-=Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.rawmode.org/pipermail/dbix-class/attachments/20060721/dd8fcf6e/attachment.pgp 


More information about the Dbix-class mailing list