need to know about mapsingletonOf
hi,
i have some basic doubt. lets say i have mapped a service as injector.mapSingletonOf( IMyservice, MyService);
when exactly does the singleton object of Myservice come into being?
For instance in one of my commands i have injected the IMyservice(its the first injection of IMyservice anywhere in the project), and i am calling a method on the injected object. Now i need to know, if the Myservice singleton instance got created when it was injected the first time, or was it created even before it was injected anywhere. i know that second time it would be injected anywhere else the same singleton instance will be delivered.
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Till Schneidereit on 13 Feb, 2012 01:27 PM
A singleton gets created lazily, i.e. it is created the first time it
is injected.
3 Posted by itsmylifesoham on 13 Feb, 2012 02:10 PM
yea, had thought the same. thanks :)
Ondina D.F. closed this discussion on 13 Feb, 2012 06:16 PM.