Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Module RFC: Yet another object-persistence interface

by perrin (Chancellor)
on Sep 21, 2003 at 18:30 UTC ( [id://293016]=note: print w/replies, xml ) Need Help??


in reply to Module RFC: Yet another object-persistence interface

It seems to me that as a persistence module Class::DBI has many more features than yours does. The main thing that makes your module interesting is the automatic setup. There are two approaches to that with Class::DBI right now, one being the use of Class::DBI::Loader (and setup_table calls), and the other being code generation with SQL::Translator. I think the most useful thing would be to fold some of what you did into one of these. Perhaps you could add things to Class::DBI::mysql, like a "guess_foreign_keys" method. At the moment, I'm using Class::DBI::mysql and it does a good job of setting up everything else, making the persistence section of my classes only a couple of lines long.

By the way, how do you clean up the hash that hold all the data in the superclass? Does it just grow forever, or do you have some way of doing reference counts to clean it up when objects go out of scope?

  • Comment on Re: Module RFC: Yet another object-persistence interface

Replies are listed 'Best First'.
Re: Re: Module RFC: Yet another object-persistence interface
by dragonchild (Archbishop) on Sep 25, 2003 at 14:26 UTC
    If I'm reading blokhead's description, his module also sets up the classes for you. Right now, you have a bunch of classes that are like 10 lines long. His removes that need by making assumptions about what those classes will generally look like. To me, that's a huge feature.

    ------
    We are the carpenters and bricklayers of the Information Age.

    The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

      Class::DBI::Loader does the same thing, and SQL::Translator does the same but with actual files.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://293016]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (1)
As of 2024-04-25 00:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found