wirebox scope question

I'm converting my app to 3.1 and I am trying to use DI. I've found
that I have a variable scoping problem with the way I have configured
wirebox. Currently my map statements don't define a scope.

For example:
map("userService").to("models.userService");

This works fine when it's just me on my dev box but if I cut it into
prod I see issues where the object is being shared when more than one
user is accessing the application.

I tried,

map("userService").to("models.userService").into.
(this.scopes.session);

but it didn't seem to help. Anyone have advice?

Jonathan, what type of persistence are you looking for. The docs gives you a wide array of choices, you have to pick what’s best for your situation.

The easiest to remember is singleton: map("").asSingleton()

Luis F. Majano
President
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

I was thinking that since most of my objects are services that I wanted them to be injected into the session so I would have one object for each mapping per user. Maybe singleton is what I but the definition of it is confusing me because what I understand a singleton to be is a variable that is referred to only once.

When you come back to Houston and have a DI class let me know.

Singleton means they are only instantiated once, and the next call to it doesn’t have the overhead of recreating the object.