OpenBLCMM
OpenBLCMM copied to clipboard
Pass around object refs for things like GlobalLogger + Options, rather than relying on static instances
OpenBLCMM does a lot of static references, using stuff like Options.INSTANCE. GlobalLogger is basically entirely static, etc. I'd kind of prefer passing around object references instead, though, so that dependencies between all that stuff is more clear. The static/INSTANCE thing has bitten me a number of times while working on OpenBLCMM, too -- for instance, I'd wanted to be able to import original-BLCMM preferences on a first-time OpenBLCMM run, but the Options class really wanted to be the only instance that there was, so a lot of that had to get tweaked to support it.
Getting rid of that kind of thing altogether might be more trouble than it's worth, so we'll have to see. It's undeniably useful to be able to just call Options.INSTANCE or GlobalLogger from Literally Anywhere and having it Do The Right Thing.
Having had this in the back of my mind for awhile, I think I'm okay with GlobalLogger working as it does -- that does kind of feel like a great use for a static class, and there aren't really any INSTANCE shenanigans in there (or at least, there's nothing like that exposed to the rest of the app). Options, however, would be nice to start passing around properly.