cdigs
03-21-2007, 04:14 PM
So I've gotten into the habit of wrapping my IApplicationContext with a singleton pattern and just now, I started wondering "Is this even necessary?".
So could anyone shed some light on this? I somehow came under the impression that GetContext() is an expensive call and that I really only needed on instance of the context. Skimming through the source, it seems like the ContextRegistry is already a singleton and the contextMap should already be performing some level of caching.
Is this analysis correct? Is there really nothing to gain by wrapping a singleton implementation around the IApplicationContext?
Thanks.
So could anyone shed some light on this? I somehow came under the impression that GetContext() is an expensive call and that I really only needed on instance of the context. Skimming through the source, it seems like the ContextRegistry is already a singleton and the contextMap should already be performing some level of caching.
Is this analysis correct? Is there really nothing to gain by wrapping a singleton implementation around the IApplicationContext?
Thanks.