[CDBI] Does Class::DBI require hash-based objects?
Matt S Trout
dbix-class at trout.me.uk
Tue Jan 3 18:54:43 GMT 2006
On Tue, Jan 03, 2006 at 05:17:57PM -0000, Jesse Sookne wrote:
> Does Class::DBI require that its subclasses (application base classes as
> described in the Class::DBI doc) use hash-based objects?
Probably. You *might* be able to get away with it if you rewrote get, set
and the _attribute_* methods but I wouldn't bet on it.
> I'm attempting to use Class::DBI along with Class::Std. Classes based
> on Class::Std don't use hash-based objects - they use scalar-based
> objects and hash-based attributes. (See the Class:Std documentation or
> "Perl Best Practices" from O'Reilly for more on this). Has anyone done
> this before?
I doubt it; Class::Std is hardly production-quality. Object::InsideOut might
be rather more interesting as such things go.
Please bear in mind that PBP is fundamentally "Damian's Best Practices", and
that large chunks of the perl community have adopted a "nod, smile, ignore"
approach to it. Damian's a great language designer but a lot of his
implementation work is pretty awful (look at NEXT.pm sometime ...)
> If this is something I need to post more info about (e.g. a failing test
> case), I'll do that. But I was hoping there might be an easy answer to
> this (e.g. some documentation I've missed, etc).
I'm working hard on getting DBIx::Class to use only a very basic API for
its result classes such that you can implement them however the hell you
like; I strongly suspect that with Class::DBI it simply isn't going to be
possible but would have no objections to being proved wrong.
Matt S Trout Offering custom development, consultancy and support
Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information
+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
More information about the ClassDBI