[Dbix-class] Re: looking for code suggestion

Fayland Lam fayland at gmail.com
Tue Jan 29 02:18:57 GMT 2008


Matt S Trout wrote:
> On Mon, Jan 28, 2008 at 10:43:42AM +0800, Fayland Lam wrote:
>> hmm, basically I'd like to use cache and others in Schema. so I package 
>> my own Foorum::Schema like this:
>>
>> http://foorum.googlecode.com/svn/trunk/lib/Foorum/Schema.pm
>>
>> use Foorum::XUtils ();
>>
>> sub base_path {
>>    return Foorum::XUtils::base_path();
>> }
>> sub config {
>>    return Foorum::XUtils::config();
>> }
>> sub cache {
>>    return Foorum::XUtils::cache();
>> }
>>
>>
>> so that in ResultSet or pl.
>>
>> we can use $schema->cache() to get the cache object. or 
>> $self->schema->cache() in ResultSet pm.
>>
>> I'm wondering if it's the correct way to do it?
> 
> Given we have no idea what Foorum::XUtils is, "no idea".
> 
> Personally I'd be a bit wary of anything that starts making per-schema
> things global though ...



well, I'd like to ask how to use Template or Cache::Cache in your 
ResultSet modules?


> 


-- 
Fayland Lam // http://www.fayland.org/
Foorum based on Catalyst // http://www.foorumbbs.com/



More information about the DBIx-Class mailing list