On Fri, 4 May 2001, Peter Donald wrote:

> >I was thinking of something simpler:
> >
> >interface SimpleThreadPool {
> >   void run( Runnable r );
> >}
> >
> >That's all you need in most cases.
> 
> true - but when you hit one of the "other" cases you have to throw away the
> pool or do some massive workarounds. Check out the hacks in Avalon that
> were used to get around the above.

The "SimpleThreadPool" is supposed to work for 80% of the cases, and
replace the 
  new Thread(runnable).start();
( which is what people would do most of the time )

For other cases you may need other interfaces - but why adding complexity
to the simple case ? 

Of course, there is space for more than one thread pool, and I think the
"common" characteristic will be the simple interface.


> >On top of this you can add other (optional) APIs ( like ThreadPoolRunnable
> >in tomcat, that saves a hashtable lookup, or any other fancy methods
> >). And of course, the implementation migh have some setters and getters to
> >configure the pool and get info - but that's specific to each
> >implementation.
> >
> >
> >IMHO a big problem with java is that it's far too easy to create
> >interfaces.
> 
> Well I believe the opposite ;) - it is far too easy to not use interfaces -
> hence the scattered interdependencies on most products.

Classical case of bad definition of terms, I think we are talking about
different things here :-)


Costin

 


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

Reply via email to