CAM-SQLObject

Last update: v1.01, 2005-04-22

Subclasses of CAM::SQLObject act as delegates for an SQL infrastructure implemented by CAM::SQLManager XML files. You name your SQL queries in the XML files (kind of like stored procedures) and call them by name from your SQLObject instance. The data retrieved from or written to the database is reflected in the instance's data structure. The goal of CAM::SQLObject is to minimize the amount of programming needed to build a full-power interface to an SQL data record.

This class is not meant to be instantiated directly. Instead, it is intended to be the superclass of real database frontend objects. Those objects may add several get[field] and set[field] routines to act as accessors and mutators for the database fields. Or, they can be very thin layers where all of the implementation is done in the SQL XML file.

See CAM::SQLManager for XML file examples and a DTD.

The CPAN module that is most similar to CAM::SQLObject is Class::DBI. The main difference is that CAM::SQLObject abstracts as much of the SQL away into external files as possible, while Class::DBI embraces the SQL and internalizes it as much as possible.

Advantages of CAM::SQLObject vs. Class::DBI:

* SQL commands are disconnected from the Perl code, allowing database adjustments without rewriting code. * Allows complex joins * Allows Perl field names to be different from SQL column names * Facilitates testing and benchmarking SQL queries

Disadvantages of CAM::SQLObject vs. Class::DBI:

* Requires nearly all queries to be written out (almost no implicit queries) * Difficult to translate free-form searches from Perl to SQL * Doesn't support foreign keys or triggers

In summary, Class::DBI is nice if you have simple tables that don't change format. CAM::SQLObject is better if you have a large collection of well-defined queries, or if your database might change, or if you need to keep an eye on all of the possible queries.

License | Files | Date
Perl | CAM-SQLObject-1.01.tgz (MD5) CAM-SQLObject-1.01.zip (MD5) CAM-SQLObject-1.01-docs | Fri Apr 22 22:37:40 2005
GPL | CAM-SQLObject-1.00.tgz (MD5) CAM-SQLObject-1.00.zip (MD5) CAM-SQLObject-1.00.html | Tue Sep 16 17:11:18 2003
Clotho | CAM-SQLObject-1.00.tgz (MD5) CAM-SQLObject-1.00.zip (MD5) CAM-SQLObject-1.00.html | Tue Sep 16 17:11:18 2003

Perl License

This software is released by Clotho Advanced Media, Inc. under the same terms as Perl itself. That means that it is dual-licensed under the Artistic license and the GPL, and that you can redistribute it and/or modify it under the terms of either or both of those licenses. Copies of this license are available from Clotho or view the LICENSE file directly.

GPL License

Releases of this software are available under the General Public License, v2. Copies of this license are available from Clotho and GNU.

Clotho License

Releases of this software are available under commercial license directly from Clotho. Please contact us at info@clotho.com to purchase a license.