I'm working on a project, written by another group, that relies heavily on a few static objects. As a result it makes the adaptability of the project pretty...well, static. For my project I want to reorganize the code to allow multiple instances rather than relying on a single static one so I can customize each instance and its behavior.
It sounds a bit easy, but I hit a problem because so much of the code refers to these static objects. In fact, many of the functions go several methods and objects deep. Imagine the simplistic example where I call method A in the static object A, and it creates object B which creates object C which creates object D, and so on. And all of these created object refer back to A in a static way . The first way that comes to mind to make this change is to pass a reference of A down the line, but is there possibly an easier way to go about it? Any and all help is appreciated....if this even makes sense