Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Alias (5735)

Alias
  (email not shown publicly)
http://ali.as/

Journal of Alias (5735)

Wednesday June 20, 2007
01:09 PM

Data::Package reloaded

[ #33562 ]

One of my smaller CPAN experiments has been around the idea of using the CPAN to deliver "Data Products", packages which consist of data.

That is, that in the same way a namespace on the CPAN can represent functionality, it can also be used to represent data or content.

The Data::Package API was designed to facilitate such a concept. It provides a simple abstraction API that lets a class advertise what formats the data can be returned in, and to return an object of that type when asked for it.

The actual storage of the data is abstracted from the user of the data, allowing the data to be changed or provided in a different manner over time, without affecting the code using that data.

The code provided in Data::Package subclasses would also provide all the heavy lifting to implement the concept.

Unfortunately, although I was happy with the API I was not happy with the implementation. It did too little and required too much code to be used when implementing data package classes.

So I've rewritten Data::Package, added a new Data::Package::File subclass for file-based data sources (that is also File::ShareDir-aware).

And for one common case, I've created a seperate Data::Package::CSV class which can be used to create CSV data products (that return Parse::CSV objects for the data).

I'll hopefully be adding a few more classes to this family, to do things like provide data sets from SQLite database and so on.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.