Nail that Moose

Well it back to the Moose-Pen for me.

Seems I have kinda drifted far from my original intent of all this blogging get a useable version of my Database::Accessor module out on CPAN. Though the last little while has been a very good learning experience for me it is time I get back on track to make sure I get a version out by Christmas.

In my first round of Moose-Pen post I gave a good example of how test driven development really does work well. The very short cycle of write a small test for requirement, write a little code, pass the test, reactor the code if needed and rerun test, it you pass out start the cycle again.

I also spend a good deal of time getting into Dist::Zilla and in this round of coding I am going to see how add in a little Dist::Zilla and Pod::Weaver to start along with my test driven development works out.

There are a number of neat little tricks that I think I can add in and use to generate more POD and take care of all the boiler-plate for me.

Now the next project I am going to be working on is my first Database Accessor Driver or DAD and I think I will make it one for SQL as I am most familuare with that, the though of doing a MongoDB driver had crosses my mind but it may take me quite a while to get my Mongo skills up to scratch to take that on.

So DAD::SQL it is and the first thing I am going to do is use dzil to create my inial package. All I need to do is

dzil new Database::Accessor::DAD::SQL
and I get

[DZ] making target dir /home/scolesj/Database-Accessor-DAD-SQL
[DZ] writing files to /home/scolesj/Database-Accessor-DAD-SQL
[DZ] guessing dist's main_module is lib/Database/Accessor/DAD/
[DZ] no license data in config, no %Rights stash, couldn't make a good guess at license from Pod; giving up.  Perhaps you need to set up a global config file (dzil setup)?
[DZ] no license data in config, no %Rights stash, couldn't make a good guess at license from Pod; giving up.  Perhaps you need to set up a global config file (dzil setup)? at /usr/local/lib/perl/5.18.2/Moose/Meta/Method/ line 110.
Checking about I see I get an '.ini' file and your basic empty module;

use strict;
use warnings;
package Database::Accessor::DAD::SQL;


Which is a nice start but really I am doing a Moose project here so I think I have to make more changes to that file to make it work for me than it saved me as my project should start like this

--use strict;
--use warnings;
package Database::Accessor::DAD::SQL;
use Moose;
with(qw( Database::Accessor::Roles::DAD));

Oh well nothing too much lost, in that. I did make me have yet another look at my namespaces. I am in the end not liking that 'Database::Accessor::DAD::SQL' as much as I liked in the begining of all of this. My role would be much better if I had named it 'Database::Accessor::Roles::Driver' much easier to understand.

Looking at that and the “Database::Accessor” name-space in genral I think an abbreviation like DAD (DatabaseAccessorDriver) realy does not fit in the same way that DBD and DBI do, unless I just use DAD::SQL which I think would cause even more problems as who whould know but me what a DAD is.

So to end up today's post my new name-space will be 'Database::Accessor::Driver' as it tell it like it is. No confusion here.

Now Dist::Zill was not much help today but at least I did nail 1 thing down.


Leave a comment

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations