 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
tony Guest
|
Posted: Sat Apr 24, 2004 3:24 am Post subject: is it good to use trigger, my teacher advise not to. |
|
|
is it good practice to use trigger, my lecturer advise not to?
he said it is going to impose a lot of trap for other team member in the
programming team.
Is it true? Any comment about the pros & cons?
|
|
| Back to top |
|
 |
Bill Todd (TeamB) Guest
|
Posted: Sat Apr 24, 2004 1:24 pm Post subject: Re: is it good to use trigger, my teacher advise not to. |
|
|
On Sat, 24 Apr 2004 11:24:00 +0800, "tony" <ahbone (AT) hotmail (DOT) com> wrote:
| Quote: | is it good practice to use trigger,
|
In my opinion triggers are a good thing. They reduce network traffic,
improve performance and centralize code in the database so that the
same functionality is available to every application that uses the
database.
--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
|
|
| Back to top |
|
 |
Bob Dawson Guest
|
Posted: Sat Apr 24, 2004 1:57 pm Post subject: Re: is it good to use trigger, my teacher advise not to. |
|
|
"tony" wrote
| Quote: | is it good practice to use trigger, my lecturer advise not to?
he said it is going to impose a lot of trap for other team member
|
The caution is proper--the presence of an unsuspected trigger can make
writing correct statements (and debugging wrong ones) quite difficult.
The conclusion (don't use triggers) is wrong. Like Bill Todd says, triggers
have important advantages in reducing network traffic and simplifying client
side code by centralizing some logic. A better conclusion would be that SQL
should only be written by the programmers who understand (or know how to
investigate) the db design--just knowing the table structures isn't
sufficient.
Pragmatic advise: don't use triggers in work done for this lecturer's class.
bobD
|
|
| Back to top |
|
 |
Phil Shrimpton Guest
|
Posted: Sat Apr 24, 2004 2:01 pm Post subject: Re: is it good to use trigger, my teacher advise not to. |
|
|
In article <4089dbfb (AT) newsgroups (DOT) borland.com>, [email]ahbone (AT) hotmail (DOT) com[/email] says...
Hi,
| Quote: | is it good practice to use trigger
|
Triggers are a good thing, and need not be avoided. One thing to make
sure of is that triggers (and SPs) contain only 'DataLogic' and not
'BusinessLogic' or you app will become difficult to maintain.
Phil
--
Discover a lost art - play Marbles
May 2004
www.marillion.com
|
|
| Back to top |
|
 |
G. Allen Casteran Guest
|
Posted: Sat Apr 24, 2004 7:02 pm Post subject: Re: is it good to use trigger, my teacher advise not to. |
|
|
In article <4089dbfb (AT) newsgroups (DOT) borland.com>, [email]ahbone (AT) hotmail (DOT) com[/email] says...
| Quote: |
is it good practice to use trigger, my lecturer advise not to?
he said it is going to impose a lot of trap for other team member in the
programming team.
Is it true? Any comment about the pros & cons?
|
As you have seen by now your instrutor's views and the real world are
vastly different. Welcome to the paradox of academia vs. real world.
Get used to it!
Take things you learn at school as concepts. Some are good and used
regularly -- others (esp. when it is prefaced as an opinion) are not and
should be discarded as flawed theories.
I used to ask instructors for real world examples to justify such
positions. Any teacher who does really know their stuff, will gladly
give you such examples to back up their theory. If they get testy and
insulted that you should ask such a question, you know where to put
thier opinions. :)
Allen.
|
|
| Back to top |
|
 |
Tony Boxer Guest
|
Posted: Sun Apr 25, 2004 5:55 am Post subject: Re: is it good to use trigger, my teacher advise not to. |
|
|
Triggers make a lot of sense, but if you use triggers you should put
comments in your code to indicate what the SQL trigger is doing. That
should hopefully keep some other programmer from getting surprised.
Assuming they bother to read your comments, of course.
Tony
"G. Allen Casteran" <allen (AT) nisinc (DOT) com> wrote
| Quote: | In article <4089dbfb (AT) newsgroups (DOT) borland.com>, [email]ahbone (AT) hotmail (DOT) com[/email] says...
is it good practice to use trigger, my lecturer advise not to?
he said it is going to impose a lot of trap for other team member in the
programming team.
Is it true? Any comment about the pros & cons?
As you have seen by now your instrutor's views and the real world are
vastly different. Welcome to the paradox of academia vs. real world.
Get used to it!
Take things you learn at school as concepts. Some are good and used
regularly -- others (esp. when it is prefaced as an opinion) are not and
should be discarded as flawed theories.
I used to ask instructors for real world examples to justify such
positions. Any teacher who does really know their stuff, will gladly
give you such examples to back up their theory. If they get testy and
insulted that you should ask such a question, you know where to put
thier opinions. :)
Allen.
|
|
|
| Back to top |
|
 |
Heiko Luettge Guest
|
Posted: Mon Apr 26, 2004 3:02 pm Post subject: Re: is it good to use trigger, my teacher advise not to. |
|
|
Hi,
well put business logic into the database is OK I think.
Example:
Personal numbers must be positive.
If the app checks this before insert into the database, is ok.
But what if someone wrote a second app and forget to check it.
After all the database can check the rule and avoid the insert.
Of cause the appliation has to know, that a insert can fails.
The next thing is, what happens if a business rule is changed ?
Recompile all apps that work with the database...
The main disadvantage I admit is the different syntax in different
databases.
Heiko
PS:
I moved from Paradox to Interbase 2 years ago.
2 years ago I did not know triggers ;)
|
|
| Back to top |
|
 |
Del Murray Guest
|
Posted: Mon Apr 26, 2004 6:16 pm Post subject: Re: is it good to use trigger, my teacher advise not to. |
|
|
Ha Ha ,,, great last comment .. you should run for some public office ...
:-)
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|