Re: Lahman, how ya doing?



Responding to Hansen...

I'd started with a Timer class that keeps the total time separately in each individual instantiation, but I thought that wasn't quite logically representative since there's only one time. I thought it still wasn't worthwhile changing that until I realized that main() was pretty much doing what I'd have Clock doing anyway.

As you noted, you only need one timer if you have different events for different frequencies. The timer just spits out the right event after the proper number of internal "ticks". If you use a single FIFO event queue, then the ordering of operations will Just Work.


But that leaves the problem of "registering" the right receivers for those events so that Timer can address them correctly. Since there is nothing dynamic about that assignment, I agree with Martin that it seems like something timer.add would do. [If the listener assignments were more dynamic in nature a pattern like Observer might be relevant.]


************* There is nothing wrong with me that could not be cured by a capful of Drano.

H. S. Lahman
hsl@xxxxxxxxxxxxxxxxx
Pathfinder Solutions  -- Put MDA to Work
http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman
(888)OOA-PATH



.