I have a personal PHP application that has about 15 classes. Each class is only initiated once as a page is executed. In other words, when the page loads:
- 15 classes are loaded, and as each class file gets loaded, I create one instance of the class.
- The application (so far) is designed so every variable in the system has one state during the generation of a page. I use global vars to access each of these
- It's worked fine for 3 years, but I am the sole developer and a goo debugger of my own code.
I have heard all the issues with Singletons, and I hate doing, "global $var" all over the place. Please tell me how to pull this type of structure out and into something developers would love. I want to write software the right way, but I can't seem to find a very simple code framework for this type of execution.
Oh - and I'm not looking for a MVC framework solution. I would love your thoughts on how I take 15 classes and turn them into a proper framework for working together. I would also love an articulation on how "stupid" it is to develop this way.