OOPS 0.1004 review

by rbytes.net on

OOPS is Object Oriented Persistent Store. SYNOPSIS use OOPS; transaction(sub { $oops = new OOPS

License: GPL (GNU General Public License)
File size: 154K
Developer: David Muir Sharnoff
0 stars award from rbytes.net

OOPS is Object Oriented Persistent Store.


use OOPS;

transaction(sub {
$oops = new OOPS
dbi_dsn => $DBI_DSN,
username => $username,
password => $password,
table_prefix => "MY";


$oops->{my_1st_bit_of_data} = 'a scalar';
$oops->{my_2nd_bit_of_data} = { A => 'hash' };
$oops->{my_3rd_bit_of_data} = [ qw(An Array) ];
$oops->{my_4rd_bit_of_data} = 'a reference to a scalar, ref, hash, or array' ];

my $old_value = $oops->{multiple}{level}{dereference};

my $object = $oops->load_object($integer_object_id);

my $dbh = $oops->dbh();


my $was_virtual = $oops->virtual_object(%{$oops->{some}{hash}, [ $new_value ]);


my $ref = getref(%hash, 'key')

The goal of OOPS is to make perl objects transparently persistent. OOPS handles deeply nested and cross-linked objects -- even object hierarchies that are too large to fit in memory and (with a hint) individual hash tables that are too large for memory. Objects will be demand-loaded into memory as they are accessed. All changes to your object hierarchy will be saved with a single commit().

Full transactional consistency is the only operational mode. Either all of your changes are saved or none of them are. While your program runs, you will see a consistent view of the data: no other running transactions will change the data you see. If another transaction changes data that you are using then at least one of the transactions must abort. OOPS will die() to abort the transaction.

OOPS maps all perl objects to the same RDBMS schema. No advance schema definition is required on the part of the user of OOPS. The name of the package (OOPS) comes from the realization that perl's data model is much more complicated than I initially understood. Internally, the RDBMS schema uses four tables: a table of objects, a table of attributes (keys and values), a table of large attributes that big the normal column widths, and a table of counters.

At this time, OOPS is expecting a web-like work flow:

create OOPS instance

access some objects

modify some objects



If you need more than one transaction in a program, create more than one OOPS instance.
To make your data persistent, make a reference to your data from the OOPS object. To later retrieve your data, simply access it through the OOPS object.


OOPS 0.1004 keywords