I have some packages that uses database connections inside it, let's call it
ConnPackage. The connection IP is a public package variable, and has a default value:
This variable is used to read database values when the package is loading. So change it value after package load don't solve the problem. The problem is similar to pass args in shell wolfram script, but must be done in the notebook.
The question is:
How could I read the
Needs, but setting
$connectionIP to be another value?
I can solve the problem defining a variable in
System. But I don't feel it's a good pattern. Here is my attempt. Inside
ConnPackage I can do:
So, if there is no value in
System`$argConnectionIP, the standard IP will be load, otherwise it will use