Frank Sommers
Posts: 2642
Nickname: fsommers
Registered: Jan, 2002
|
|
Re: How Much Concurrency Should be Exposed in a UI Toolkit?
|
Posted: Jun 15, 2007 8:48 AM
|
|
> Computations which take time should be executed in a > different thread, so as that the UI remains responsive. > Short computations should be executed in the same thread > as the GUI. > > It's a simple rule really, and I don't know why is there a > topic in Artima about this. What's more to say on this?
Indeed, it's a simple rule, and it works well, in fact, for what it is.
The trouble, though, is that many other UI APIs don't have this sort of requirement. In Ajax, for instance, you simple register callbacks on, say, HttpURLRequest; Flex works the same way.
One answer to this may be that Swing and those other APIs are totally different, and that Swing is really more powerful and was designed for a different purpose. That may well be so.
My point merely was that there is a large class of applications where I'd want to use Swing much, much more than I'd use, say, an Ajax library. But when you look at the amount of code, and amount of work, needed to accomplish the same functionality in one vs the other, I'd say that Swing requires more of both. (Ajax has other problems, of course, which is exactly why I'd rather use Swing. Flex seems to require less code than Swing, and does solve some of the problems with Ajax.)
As someone mentioned, JavaFX may be the answer, and that's great news then.
|
|