Triggers are evil, yes or no?

Hello

Actually I've discussed to solve a specific task using a static trigger. This had created a difficult internal discussion about the problems and the damages which can be created by triggers.

What is your real experience with triggers? Are the usable or are they a problem?

Best regards

Wolfgang

 


Wolfgang Uhr - Tue Oct 07 08:40:45 EDT 2014

Re: Triggers are evil, yes or no?
HazelWoodcock - Tue Oct 07 12:33:43 EDT 2014

Triggers aren't evil as such, but they can be troublesome. If you know what you are doing, and you are writing quality code, then they are no problem, there are plenty of cases of people using them with no issues at all. However, if you are not sure of what you are doing, are inexperienced with coding, or unfamiliar with DXL then they are best avoided.

Some years ago, as a non-software engineer who had struggled on the 3 day DXL course, I tried using triggers and could reliably crash DOORS every time. After sending my code to someone who knew what they were doing it came back running perfectly and I never had another problem.

I would say use them if you know what you are doing, and ask for help if you don't.

Re: Triggers are evil, yes or no?
llandale - Tue Oct 07 12:35:45 EDT 2014

Evil people wanting to do evil things with DXL will most likely choose Triggers, as opposed to Attr-DXL or Layouts.  So a policy of denying triggers coupled with some script that looks for them can thwart evil people somewhat; but not enough to thwart determined evil people.

But I assume you are talking about good folks accidentally doing something harmful.  Triggers are certainly trickier to get deployed correctly and to fire when exactly you want and can more easily conflict with each other.  But I don't think they are any more dangerous to the database then Attr-DXL or Layouts; they do not provide any extra access or privaleges.  They do demand more rigorous testing.

Most trigger problems can be resolved by a Database manager starting DOORS with triggers turned off via "-T" command line switch.  Now triggers can be sought without firing them off.   Most folks dealing with triggers will eventually write a pre-module-open trigger that denies opening the module, or a post-module-open trigger that closes the module.  Even this basic denial is easy to fix once identified.

-Louie

Re: Triggers are evil, yes or no?
HazelWoodcock - Mon Oct 13 09:58:08 EDT 2014

llandale - Tue Oct 07 12:35:45 EDT 2014

Evil people wanting to do evil things with DXL will most likely choose Triggers, as opposed to Attr-DXL or Layouts.  So a policy of denying triggers coupled with some script that looks for them can thwart evil people somewhat; but not enough to thwart determined evil people.

But I assume you are talking about good folks accidentally doing something harmful.  Triggers are certainly trickier to get deployed correctly and to fire when exactly you want and can more easily conflict with each other.  But I don't think they are any more dangerous to the database then Attr-DXL or Layouts; they do not provide any extra access or privaleges.  They do demand more rigorous testing.

Most trigger problems can be resolved by a Database manager starting DOORS with triggers turned off via "-T" command line switch.  Now triggers can be sought without firing them off.   Most folks dealing with triggers will eventually write a pre-module-open trigger that denies opening the module, or a post-module-open trigger that closes the module.  Even this basic denial is easy to fix once identified.

-Louie

Louie, you make a good point; they are not especially dangerous to the database integrity, but they are tricky to use.

Re: Triggers are evil, yes or no?
Wolfgang Uhr - Tue Oct 14 09:48:19 EDT 2014

HazelWoodcock - Mon Oct 13 09:58:08 EDT 2014

Louie, you make a good point; they are not especially dangerous to the database integrity, but they are tricky to use.

Thanks for both answers, I think I will be able to mange this problems. The errors and problems seems to be "Trigger problems". And having triggers is not a feature only supported by dxl. So I think, that I'll be able to mange that.

Best regards

Wolfgang