Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: A Growing Dislike for SQL-OOP Mappers

by zby (Vicar)
on Aug 22, 2005 at 15:00 UTC ( #485703=note: print w/ replies, xml ) Need Help??


in reply to A Growing Dislike for SQL-OOP Mappers

Just one word: triggers.

From the Class::DBI documentation:

TRIGGERS __PACKAGE__->add_trigger(trigger_point_name => \&code_to_execute); # e.g. __PACKAGE__->add_trigger(after_create => \&call_after_create) ; It is possible to set up triggers that will be called at various point s
Triggers are the database way of running some extension code upon creating a record and Class::DBI tries to do it in a manner as similar as possible.


Comment on Re: A Growing Dislike for SQL-OOP Mappers
Download Code
Re^2: A Growing Dislike for SQL-OOP Mappers
by jk2addict (Chaplain) on Aug 22, 2005 at 16:06 UTC

    Sure....if I'm using CDBI.

    That doesn't change the overall premise. Your modules public API should not be the DBI layers API.

Re^2: A Growing Dislike for SQL-OOP Mappers
by pg (Canon) on Aug 22, 2005 at 17:48 UTC

    First make one thing clear for people who donít know: those triggers are at application level, not the database level. In general, I am against the idea of using those triggers, unless the database itself does not support database level trigger. Those triggers actually could be much more complex than it first looks like, especially when data integrity becomes a concern and complex locking issues. When you deal with database, leave as much as possible to the database.

      i agree (leave as much as possible to the db -- of roucse there are exceptions to every rlue as well), BUT in reality sometimes that's just not possible. Reasons could include db that doesn't support it, a DBA that doesn't support it, a DBA that can't support it, lack of a DBA altogether, or some combination of those or other reasons. (yes, crappy, but those conditions are out there)

        Don't forget solar flares! Those are well known to inhibit the availability of triggers. :-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (13)
As of 2014-07-23 07:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (136 votes), past polls