Richard O. Hammer wrote:
I might get what I want by extending both Timer and TimerTask, but I thought object oriented design offered simpler ways to achieve such simple augmentations in behavior.

It does, but the author of the Timer class would have to take that
into consideration in order expose the functionality you wish to extend.

In this case, the functionality is contained within the TimerThread
class, which is not made public -- making it completely impossible
for you to extend.  This is not a failure of OO so much as it is a
failure of the author to anticipate future needs.  From a quick
perusal of the source, there was no consideration given to the
situation you encoutered in the design.

Clearly the author intended you to catch any exceptions before
propogating them to the TimerThread.  Following with that design
philosophy, you should put a try...catch(Throwable) around all
your "run" methods.


C


--
-------------------------------------------------------------------------
Chris Merrill                  |  http://www.webperformanceinc.com
Web Performance Inc.

Website Load Testing and Stress Testing Software
-------------------------------------------------------------------------

_______________________________________________
Juglist mailing list
[email protected]
http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to