Christopher H. Laco wrote:
> Steven Mackenzie wrote:
>   
>> Christopher H. Laco wrote:
>>     
> There's no reason you can't put this in your schema class:
>
> sub MyBest {
>    return shift->resulset('MyBest');
> };
>   
Thanks for the tip (and Dan and Mike) -- I think I will do that in future.
> As for the above examples, they're not the best. The main point is, the
> name used in resultset() could be the class name or the source_name. Any
> number of classes can use the same table, so just adding shortcuts for
> the table name is futile. People can set the source_name to abstract
> away from the class names, so when the class names change, the
> resultset() calls don't have too....and various other reasons...
>   
Yes, you've convinced me that the shortcut methods shouldn't be to the
class or table name.

But the accessors to source_name could be provided in the schema object
by default without limiting the ability to decouple source_name from the
table name. If source_name is not set, then it is implied currently
anyway (defaulting to the table name?)

Thanks for the clarity, and thanks to Mike for the question!

Steven



_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to