peter royal wrote: > On Mar 4, 2006, at 9:37 AM, Michael Link wrote: > >> I think this concept would be orthogonal to the Filter-Chain concept; >> instead of a chain you have decorator of the filter. And life-cycle >> management still works as designed except in the cases where the >> user/container explicitly manages the IoFilter. Doesn't solve the >> current deadlock problem in ThreadPoolFilter but perhaps adds >> something to the discussion about automatic/manual life-cycle >> management. > > > I like this! But I'd invert it -- the behavior of the IoFilterLCM could > be a decorator.. If it is desired for an IoFilter to be destroyed when > not in use, then prior to adding to the template chain, it would be > wrapped in a decorator. > -pete >
I like this too, though I think we also need to provide a solution which achieves the same thing using inheritance instead of delegation. I'm thinking that most of the time the developer of an IoFilter will know at design time whether the filter needs life cycle management or not. If the filter requires LCM it shouldn't be up to the user to make this happen. /Niklas
