Q
Problem solve Get help with specific problems with your technologies, process and projects.

Script libraries vs. global form scripts

My question is in regards to scope and performance. I'd like to know when is the right time to use script libraries vs. global form scripts vs form events. I want to use scripts in the places that make the most sense, but also make don't have a negative impact on performance. I have never been able to find any guidelines on this type of thing.

To be honest, it's mostly a matter of style.

If it's something that is a base unit (something that might be useful in more than one place, either in the database or in more than one database), I put it in a Script Library.

If it's something that has impact only to a particular form, but may be used in more than one place on the form, I make it a global reference.

If it's something that will be used by a particular piece of code on a form, but nowhere else on the form, I put it in the form's code.

Within each piece of code, I try to declare my variables as specifically as I can (in the subroutines vs. the global declarations, for instance), unless the same variable is going to be passed around from subroutine to subroutine, because LotusScript (like VB) is occasionally "leaky" when trying to clean these references up, plus it's quicker. And. let's face it, code running on a form usually runs a couple of times, whereas code running in an agent may run hundreds of thousands of times before the memory buffer is cleared.


Dig Deeper on Domino Resources - Part 6

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close