So I have these Service Objects that are instantiated during onApplicationStart(). During the onRequestStart(), I make a pointer in the variables scope to each, so they can just be called by their name (cause 'UserService') is the same as ('variables.UserService') and the latter takes less to type. GO TEAM CODE PRETTY-FICATION!
Anyways, during the processing of the Request, I'm finding I have to pass (as a reference) the entire variables scope to all my functions, just in case they have need of a Service. Heck, I have a Config object that holds the application's configuration settings, so if a method needs to know the path to the controller's folder, it needs to be able to get to the variables scope where I stored my Objects.
But with all this object passing, I feel I'm not doing this in the most optimal way.
From the application.cfc point of view, the variables scope has those objects in it. But after code in the application cfc does some includes of files which might include other files, those lower-level files don't seem to have access to that upper-level variables scope (espeically when they are called from the context of other services and methods which have their own respective variables scope)
So is there a simpler way of doing this, or is this what I am relegated to, since I am choosing to take an OOP design approach rather than procedural?