I am cleaning out my drafts and found this two year old post titled “Globals Glob” with no content. The story is worth telling so here we go.
There was a class the EVE client used to control how missiles behaved. We needed to start using it in our tools for authoring missiles with their effects and audio. The class and module was definitely only designed (I used the term loosely) to run with a full client, and not inside of our tools, which are vanilla Python with a handful of modules available.
My solution was the
GlobalsGlob base class, which was just a bag of every singleton or piece of data used by the client that was unavailable to our tools. So instead of:
ClientGlobalsGlob called the service, but
FakeGlobalsGlob did nothing. The
GlobalsGlob allowed us to use the missile code without having to rewrite it. A rewrite was out of the question, as it had just been rewritten, except using the same code. (sigh)
GlobalsGlob was super-fragile. So we added a test to make sure the interface between the client and fake globs were the same, using the
inspect module. This helped, but of course things kept breaking.
This all continued until the inevitable and total breakdown of the code. Trying to use the missile code in tools was abandoned (I think it was, I have no idea what state it’s in). This was okay though, as we weren’t using the missile tools much after those few months.
GlobalsGlob served its purpose, but I will never be able to decide if it was a success or failure.