APM: Database wrapper classes

Larry Hunter lhunter at lhunter.com
Wed Aug 14 02:44:52 CDT 2002


I did a customization of Bugzilla a couple of years ago that followed 
Hrunting's and Erik's suggestions: a middle layer that included generic 
select and update generators. It worked out nicely and only needed a few 
non-specific queries. Those were probably worth hand-tweaking anyway.

At 09:48 AM 8/13/02 -0500, Wayne Walker wrote:
>On Tue, Aug 13, 2002 at 09:38:16AM -0500, Hrunting wrote:
> > On Tue, 13 Aug 2002, Wayne Walker wrote:
> >
> > : Hi Everyone,
> > : ...
> > :         delete($id)
> > :         get($id)
> >
> > That is the best way.  Hide the logic behind the middle layer.  What I
> > like to do is create a generic *::DBI class that inherits from DBI and
> > stores the information for connecting to the database I need (through
> > methods like *::DBI->connect() or *::DBI->connect_ro()) and have the
> > wrapper classes use that (so they don't have to know anything about
> > user/pass information, etc.
> >
> > If I ever need to do more complex work than my wrapper classes allow, I
> > just use the *::DBI class to pull my database connection and do the
> > work manually.
> >
> > Generally, if I'm doing complex SQL outside of my wrapper classes, it's
> > for specific queries that aren't handled well by a wrapping model.
>
>Rats! I have one vote for "there's not a better way Wayne, suck it up
>and quit being lazy"
>:)
>
>Someone out there got a better/different solution?
>
>...snip...
>_______________________________________________
>Austin mailing list
>Austin at mail.pm.org
>http://mail.pm.org/mailman/listinfo/austin

------------------------------------------------------------------------
Larry Hunter           lhunter at lhunter.com           http://lhunter.com/




More information about the Austin mailing list