On Fri, Jul 28, 2000 at 08:33:57AM -0700, Michael Nachbaur wrote:
> <Warn priority="low">
>   <warning class="Off Topic"/>
>   <warning class="Long"/>
> </Warn>
> 
> I'm not exactly sure where to send this, but here it goes:
> Has anyone completed/started an abstract database class at all?  I've written some 
>for very specific applications, but I want a more general-purpose tool.  I'm about to 
>start development on one, but wanted to get feedback from the world-at-large to see 
>what features you would want first (or if anyone has already started one).
> 
> The classes I've created/used before, are like:
> my $order = new Order( oid => '1234567' );
> $order->fetch();
> foreach my $order_line ( $order->Lines ) {
>   print $order_line->Description, $order_line->Price;
> }
> 
> I'd like to interact with a database, update data, save data, etc.  without having 
>to actually call any SQL code.  And, if I modify my database schema, I'd like the 
>classes to automatically adapt.
> 
> The way I've done this before, is create a series of classes with AUTOLOAD subs in 
>them which intercept the name of the method being called, and then updating that 
>specific field in the record.
> 
> How I"d like to implement it would be to define an XML file with represents the way 
>my data is structured in the database.  This way, the objects can determine when to 
>cache data, and when to commit its values to the database for maximum efficiency.  An 
>example could be:

I have an object database abstraction that I use for a bunch of stuff, including a set 
of RDF libraries. "object" is a perl datastructure defined by an SQL table. The 
purpose of ObjectDB is to allow programs to store objects, create objects, load 
objects from the DB (including all objects linked via external keys) and cache the DB 
interactions to keep it all efficient. The bulk of the work is in an importer that 
reads a database structure and generates a .pm with class defs, and a bunch of code 
for handling the implications of unique indexes.

Take a look at http://www.w3.org/1999/02/26-modules/ and 
http://dev.w3.org/cvsweb/perl/modules/W3C/Database/ to see if you are interested in 
leveraging off ObjectDB or just ripping off code. 

-- 
-eric

([EMAIL PROTECTED])

Reply via email to