With regard to (3), just for info... Flex has these methods on UI components, so the name would be familiar to Flex developers as well. That said, Adobe recommend that developers use Timers instead, though it depends what you're trying to achieve. Flex also has a callLater function for adding things to the UI thread queue.
Similarly Swing has the following methods, which I think are self explanatory: http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/SwingUtilities.html#* invokeAndWait*(java.lang.Runnable) http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/SwingUtilities.html#* invokeLater*(java.lang.Runnable) If it were up to me, I would deprecate setInterval, clearInterval, setTimeout and clearTimeout in favour of using Timers (or even custom threads) and add a callLater(Runnable) method. Cheers, Chris 2009/3/19 Todd Volkert <[email protected]> > >>(1) Not being able to have my own main method is not great. > >>(2) Similarly, having the format of my command-line arguments predefined > >>for me is also not ideal. > > > > Could you create a custom subclass of ApplicationContext? It's actually > not terribly difficult to do so. Another alternative would be to add hooks > into DesktopApplicationContext that you could override. > > Another way to go would be to write a main method in your Application > that called into DesktopApplicationContext's main method. This would > allow you to support whatever command-line argument format you needed > and translate that internally to DesktopApplicationContext's format. > The bottom line is that we can't anticipate every command-line format, > but we don't preclude the application developer from supporting their > own formats in their applications. > > >>(3) ApplicationContext - setInterval, clearInterval, setTimeout, > >>clearTimeout are not great names. > >>addIntervalTask(), removeIntervalTask(), addTimeoutTask(), > >>removeTimeoutTask() would be much better. > > > > I'm not opposed to changing the names, but I actually don't think they > are too bad - they are consistent with their JavaScript equivalents. If we > were to change it, "Task" is probably not the right terminology, since > you're queueing a Runnable, not a pivot.util.concurrent.Task. "Callback" > might be better. > > Yeah, these were designed to be familiar to AJAX developers... six of > one, half dozen of the other. >
