You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Byrne, Steven" <SB...@dorado.com> on 2004/02/12 22:08:05 UTC

Extension lifetimes?

I'm experimenting with using extension classes as part of my
application.  I'm using the immediate instantiation mode, but I'm
running into the following behavior:
 
If I have an extension declared in library "generic", the extension
object seems to be being instantiated for EACH TIME the library is
referenced (i.e. once by the main .application, and once from some other
library that mentions the "generic" library).  Howard's book seems to
indicate that extensions are singletons and won't be instantiated more
than once (for a given definition, I think he means, so if I had the
same extension class mentioned with a different name in a different
.library file or .application, I would expect to see an instantiation
from that additional definition as well).
 
Can anybody enlighten me as to what the correct expected behavior is?
I'm running in development mode, with the disable-caching flag turned
on, if that matters.
 
Steve
 

Re: Extension lifetimes?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Extensions are as you experienced, one per "library" (an application is 
a specific kind of library).  Whether that is ultimately by design, I'm 
not sure, but that is how it is coded to work.

	Erik

On Feb 12, 2004, at 4:08 PM, Byrne, Steven wrote:
> I'm experimenting with using extension classes as part of my
> application.  I'm using the immediate instantiation mode, but I'm
> running into the following behavior:
>
> If I have an extension declared in library "generic", the extension
> object seems to be being instantiated for EACH TIME the library is
> referenced (i.e. once by the main .application, and once from some 
> other
> library that mentions the "generic" library).  Howard's book seems to
> indicate that extensions are singletons and won't be instantiated more
> than once (for a given definition, I think he means, so if I had the
> same extension class mentioned with a different name in a different
> .library file or .application, I would expect to see an instantiation
> from that additional definition as well).
>
> Can anybody enlighten me as to what the correct expected behavior is?
> I'm running in development mode, with the disable-caching flag turned
> on, if that matters.
>
> Steve
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org