Monday 7 September 2009

My first CPAN module

So I have pushed my first ever CPAN module, MooseX::Storage::File_or_DB

http://tinyurl.com/l3xfkc

I blogged about this as I started the module before

http://vampiresoftware.blogspot.com/2009/08/filesystemdatabase-or-both.html

and this weekend I was finally able to finish the first release.

As of the moment, you need to use this by extending it

package MyClass;
use Moose;
extends q{MooseX::Storage::File_or_DB};

But I hope for a future release just to be able to

use MooseX::Storage::File_or_DB;

This gives functionality to enable you to write to either a file a JSON string, or a database, and re-instantiate the object from either.

It makes heavy use of MooseX::Storage ( http://tinyurl.com/nujf4c ) - a big thanks to Tomas Doran for writing this - for inspecting the object, and providing the ability to write out to a file as a JSON string.

I hope that this will prove useful. Please do read the POD/CPAN page before use, and contact me about anything you feel relating to this - all constructive comments gratefully received.

2 comments:

Matt S Trout (mst) said...

Given you've put this under MooseX::Storage:: it needs to work as a MooseX::Storage driver - you should never be referencing File_or_DB directly at all.

If you don't want to implement the MooseX::Storage API then this needs to be deleted from CPAN and re-released under a better namespace.

-- mst

Unknown said...

It seems I have made a mistake here about naming it. I'm waiting to hear back from Stevan Little, and will then move it/change it.