I really like the philosophy behind what Berin is proposing here. You do
need to understand the lifecycle you are working in for component usage,
but how is that new....
>
>
>> From: Berin Loritsch [mailto:[EMAIL PROTECTED]]
>>
>> > From: Leo Sutic [mailto:[EMAIL PROTECTED]]
>> >
>> > Berin,
>> >
>> > I am 75% for your new CM interface. The problem is point 4.
>>
>> Am I not a prophet?
>
> :)
>
>> > Assume you have a CM that automatically reclaims all
>> > components after each request. That is, for Cocoon, when the
>> > request comes in, the CM starts keeping track of what
>> > components have been taken out, and when the request has been
>> > processed, they are release()'d (or equivalent method).
>> >
>> > Now introduce pooled components.
>> >
>> >     If more than pool-max components are looked-up during
>> >     the request you are not performing well, as you empty
>> >     the pool.
>>
>> I thought I already did introduce pooled components.  It's
>> really simple.  The GC process for components releases
>> them--just like we currently do. The GC process is done
>> after the Response is committed.
>
> The scenario was when more than pool-max lookups had been
> done before the GC kicks in. Suppose you have a pool-max of 3:
>
>   public void handleRequest () {
>      someMethod ();
>      someMethod ();
>      someMethod ();
>      someMethod ();
>   }
>
>   public void someMethod () {
>      manager.lookup (ExpensiveButPooledComponent.ROLE);
>      ...
>   }
>

This is why I replied - please don't take offense, but why on earth would
you could it this way?!?! That sets of all kinds of personal warning flags
of programming practice for me. The framework can't and shouldn't make up
for an inefficient compoenent - and your example here looks to be exactly
that - very inefficient.
I'm am struggling with a real-world example of why you would NEED to do
something htis way...if you have one, please provide it...

> With an explicit release() this could be made not to drain the pool.
> With GC you can not, unless you set the timeout ridiculously low.
>
<snip/>



-- 
"The heights of genius are only measurable by the depths of stupidity."



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to