The other way around is to be avoided since it would introduce scope widening.
That is correct. A hard reference from a singleton will cause the referenced object to be created only once (Upon injection) and held in memory for as long as the reference (and singleton) exists.
I can’t stress the usefulness of looking through stack traces. You might spend all day guessing at what is slow, but refreshing a few stack traces while it’s running can tell you exactly what’s consuming the majority of cycles.
Kudos on your understanding of what you’re doing. DI can be a confusing subject for people not used to working with object factories.
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com