[Dbix-class] Re: Result, ResultSet and load_namespaces

Frank Schwach fs5 at sanger.ac.uk
Fri Jul 27 08:29:55 GMT 2012


I'd second this: the loader is great to get started but after a while it 
becomes a bit of a drag and you can make changes and additions to your 
schema much more quickly and efficiently if you can edit the "core" of 
the Result classes rather than having to add stuff to the end.
Moose Roles are great for adding shared functionality between Result 
classes. I also use them for that.
Check out this post for some how-to for Mosse roles in Result and 
ResultSet classes: http://www.perlmonks.org/?node_id=968402

I think a bit of the confusion could be avoided by making it clearer 
perhaps in the docs that a Result class describes a single row of a 
table whereas the ResultSet class handles methods for handling sets of 
rows, e.g. for adding a shortcut method to a complex search on a table.

Frank


On 26/07/12 19:09, Bill Moseley wrote:
> On Thu, Jul 26, 2012 at 6:59 AM, Alejandro Imass <aimass at yabarana.com 
> <mailto:aimass at yabarana.com>> wrote:
>
>
>
>     So now I ask:
>
>     The elegant way to extend row-level methods is by extending the code
>     in the Result classes below the checksum created by Loader?
>
>
> We had the need to share row methods between somewhat different 
> schemas and used Moose Roles to accomplish that.   So, that might be 
> an approach to consider.
>
> We also don't use Loader (other than initially).  That's something to 
> evaluate as your schema grows.
>
>
> -- 
> Bill Moseley
> moseley at hank.org <mailto:moseley at hank.org>
>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk


-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 



More information about the DBIx-Class mailing list