- Two hooks, one for retrieval and one for storage? I think that's probably
the way to go
I like the second-argument-means-replace semantics of the notes
function, and like "pnotes" more than "store" since "store seems like
a lower-level thing, as STORE and FETCH are the tie methods.
Certainly one calling mechanism as with ->notes(), but I like the idea
of writing two separate hooks for storage and retrieval, rather than
having a single hook that does the job of figuring out whether it was
being called for storage or retrieval :) The name doesn't matter much to me
with a key,value interface, allowing the key to be an array-ref would
give the any-number-of-keys thing without sacrificing the
second-arg-is-replacement-value thing.
I like that idea. And let the plugin decide how to deal with it:
my ($self,$txn,$key);
$key = join '_',@$key if ref $key eq 'ARRAY';
# or
my $table_name,$row_name = ref $key eq 'ARRAY' ? @$key
: ('default_table',$key);
-Jared