V
Vineet Jain
I started off doing the following:
Class someClass(Singleton):
This worked fine but was not elegant. I'm using a large number of Singleton
classes. And Having to create a new object and discard it millions of times
added up. My functions get called many many times.
So I decided to use a GlobalMadules class which has all my global classes
and resources. I initialize this at the begining of my program.
The problem is that in the main program I have to do:
from GlobalModules import initGlobalModule
from GlobalModules.someGlobalClass import someGlobalClass
def someFunction:
initGlobalModule()
someGlobalClass.conn(qry)
does not work since someGlobalClass has not been initialized, so I have to
do the following:
def someFunction:
initGlobalModule()
from GlobalModules.someGlobalClass import someGlobalClass
someGlobalClass.conn(qry)
Somehow I like all my import at the top of the file and this does not seem
right. Is there some other way to do this?
Thanks,
Class someClass(Singleton):
This worked fine but was not elegant. I'm using a large number of Singleton
classes. And Having to create a new object and discard it millions of times
added up. My functions get called many many times.
So I decided to use a GlobalMadules class which has all my global classes
and resources. I initialize this at the begining of my program.
The problem is that in the main program I have to do:
from GlobalModules import initGlobalModule
from GlobalModules.someGlobalClass import someGlobalClass
def someFunction:
initGlobalModule()
someGlobalClass.conn(qry)
does not work since someGlobalClass has not been initialized, so I have to
do the following:
def someFunction:
initGlobalModule()
from GlobalModules.someGlobalClass import someGlobalClass
someGlobalClass.conn(qry)
Somehow I like all my import at the top of the file and this does not seem
right. Is there some other way to do this?
Thanks,