> From: Peter Donald [mailto:[EMAIL PROTECTED]
>
> On Mon, 3 Mar 2003 21:48, Leo Sutic wrote:
> > > From: Peter Donald [mailto:[EMAIL PROTECTED]
> > >
> > > Hi,
> > >
> > > I have added a Closeable interface into Logkit
> >
> > OK, but even with a closeable interface the question is:
> >
> > If a LogTarget wraps another LogTarget, should it
> > close the wrapped target when it is closed?
> >
> > The answer so far is *no*. OK, so we can solve this in
> > two ways (I'm sure there are more):
>
> Does it need solving? In many situations one target may be in
> a chain and the wrapper logtarget may wrap part of the chain.
> Having the wrapper close the target could effect other targets
> who share the chains.
Yes, that's why both my attempts make it optional to close the
wrapped target.
> Why can't a central manager component who tracks all targets do
> the closing?
Well, let's turn the question around: Why should we force that pattern
on the developer? The idea of having wrappers working like the
InputStream wrappers is because Java developers will understand how
it works as it is similar to patterns established by InputStream etc.
I'm sure that you can solve it with a central manager component, but
why make that the only pattern?
As Michael Bachran stated in:
http://marc.theaimsgroup.com/?l=avalon-dev&m=104496210014916&w=2
there is a use case for having wrapper targets close the wrapped target.
/LS
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]