Class-AutoDB

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

Class-AutoDB

This class works closely with Class::AutoClass to provide almost
transparent object persistence.  You can declare any class to be
persistent and can easily store any objects of a persistent class.
You can retrieve a stored object explicitly through a query
mechansism, or implicitly by following a reference pointing to the
object.  The persistence mechanism preserves the structure of the
object network: if objects A and B pointed to C when they were stored,
the retrieval process will reconstruct this relationship.

This class presently works only with MySQL. 

CAUTION: This module is old. We use it internally, and while it works

docs/Developer/Serialize.pod  view on Meta::CPAN


What distinguishes Class::AutoDB::Serialize from the many other
excellent Perl serialization packages (eg, Data::Dumper, Storable,
YAML) is that we serialize objects as independent entities existing
within a large network, rather than serializing entire networks as a
whole. When an object is being serialized, other
E<ldquo>auto-serializableE<rdquo> objects that are encountered are not
serialized then and there; instead a placeholder object called an Oid
(short for I<object identifier>) is emitted into the serialization
stream. When the object is later fetched, the placeholders are not
immediately fetched; instead each placeholder is fetched transparently
when the program invokes a method on it (this is accomplished via an
AUTOLOAD mechanism).

The purpose of all this is to make it easy for Perl programs to operate
on large databases of objects. Objects can be created, stored, and
later fetched. If the object points to other objects, they will be
fetched when needed. New objects can be created, connected to the
network of existing objects, and stored.

=cut

lib/Class/AutoDB.pm  view on Meta::CPAN

  my @all_objects=$autodb->get;

  # delete objects
  #
  $autodb->del(@males);                                  # delete the boys  


=head1 DESCRIPTION

This class works closely with L<Class::AutoClass> to provide almost
transparent object persistence that can coexist with a
human-engineered database. The auto-persistence mechanism provides
hooks for connecting the two parts of the database together.

B<Caveat>: The current version only works with MySQL.

For applications where performance is not pressing, you can use this
class for all your persistent data.  In other cases, you can use it
for structurally complex, but low volume, parts of your database,
while storing performance-critical data in carefully engineered
tables.  This class is also handy for prototyping persistent



( run in 0.659 second using v1.01-cache-2.11-cpan-0a6323c29d9 )