I would appreciate any thoughts concerning the best style to use in the following situation.
I acknowledge that some do it one way, while others do it another. I am looking for thoughts regarding what is the “best,” and most practical method with AppleScriptObjective. I am still fighting the temptation to write in a more linear fashion. The examples I use here are completely made up.
Let us suppose, as examples, that we have two different menus. Each menu opens up a separate window. In Window 1, the user enters two numbers, presses “OK”, and gets the sum of the two numbers. Easy enough.
Suppose Window 2 does a different calculation. Suppose Window 2 calculates the number of days between two dates. (Again, these are just examples, I wouldn’t actually do it this way.)
For both examples, we use an independent window, so, we have two windows. Both windows have an “OK” button. When you click the “OK” button, the calculation is made and displayed. The second button says “Cancel.” When you press the “Cancel” button, (and here is the issue that I am asking about) the window simply goes away, reasonably enough.
Keep in mind that here we have only two windows, but we could have had twenty windows. Should I be creating a separate “close the window routine,” one for for each window, or should one common “close the window routine” be used by all twenty windows? I can see advantages and disadvantages to both (passing information, etc). However, because I am new to AppleScriptObjective-C, I am looking for the “best approach.”
Any thoughts are greatly appreciated.