On 28/03/11 16:49, Sam Brain wrote:
I would like ask the group for advice on module naming, as I have seen
some missteps in the past.
I have written a small module which takes the output of
DBI::fetchall_arrayref() or its ilk, and generates Moose objects from it.
Showing great imagination, I have called the module
DBIx::BuildMooseObjects. I picked "DBIx::" as the module's functionality
seems to fit the DBIx namespace.
There are two main exported routines, rather clumsily named
mk_AoMobj_from_2d_array() and mk_complex_Mobj_from_2d_array(). The first
returns a (ref to) an array of (already-declared) Moose objects, the
second (a ref to) an array of complex, nested Moose objects (sub-objects
declared as "isa => 'ArrayRef[...]' " )
You'll want to make sure the unrolling is configurable.
The crawling horror that is _collapse_result in DBIx::Class::ResultSet
may prove enlightening as to the contortions one ends up going throw to
make this stuff work.