in reply to Re: Sharing objects between modules
in thread Sharing objects between modules

That's perfectly fine in many cases; it's as much a singleton as anything else.

One potential drawback is that it's possible to overwrite a global variable, though. If you use some sort of closure to store the singleton, you'll have less chance of overwriting the variable accidentally.

  • Comment on Re: Re: Sharing objects between modules