The Success of Java

by Ted Neward

Java enjoys something of a tarnished history, in some ways. Originally held up as the penultimate client-side technology--everybody remember when "Write Once, Run Anywhere" was the sole slogan for Java?--Java has since more or less abandoned its client-side roots in favor of its success on the server-side in J2EE. And yet, Sun just can't quite give up on the idea of "Java everywhere": server-side, client-side, even PDA-side. They sink millions of dollars in time and salaries in perpetuating the Swing libraries from one JDK release to the next, all to be greeted with comments like, "Java Swing is not good for GUI development" or the more colloquial "Swing Sucks".

Realities of Economics


Let's establish a few facts up front here, before we continue with the analysis:

  1. Sun is engaged in a fight with Microsoft over the future of enterprise computing. Anybody who doesn't see this needs to stop talking to the volleyball. It's .NET vs J2EE, no holds barred, with the referee (the DOJ) taking a coffee break and munching on a donut.

  2. Sun is smaller than Microsoft. This is another indomitable fact--Sun simply doesn't have the same kind of resources to throw at Java that Microsoft does at .NET, particularly when we stop to realize that Sun is also a hardware manufacturer, and derives much (most?) of its income from that line of work.

  3. Software development requires resources. Money for infrastructure, money for salaries, employees' time, these are all non-trivial costs associated with any particular software (or standards) development project. Resources are finite (thank you Keynes), so Sun needs to make sure that the investment in resources yields commensurate payoff--not in "web presence", which was sooo 1990's, but in hard cash.

  4. "You cannot strengthen the weak by weakening the strong". This quote, by Abraham Lincoln, highlights a key principle: sinking money into something that's not yielding results, when that money could go into something that does, is not a great business prospect. Medical guys call it triage. Business types call it "rightsizing". I call it "smart investment".

  5. Further development is necessary. Swing needs additional enhancements, and will always need additional enhancements, for the lifetime of the project. Changing UI guidelines, new looks from Microsoft (among others), new hardware that needs to integrate within the UI, all of this represents a perpetual employment curve for Swing coders. Can you say "Big Black Hole"?

  6. Portable GUIs are hard. Without exception, Swing is the largest project in the J2SE library, and easily (I'm guessing) represents more than half of the development effort for any given J2SE release. Consider the staggering goals of this project: to produce a cross-platform, natively-drawn, GUI toolkit. I remember going through this phase back in 1992-94, when C++ ruled the roost and toolkits like XVT, Zinc, and zApp promised cross-platform applications with just one source base. "No #ifdefs!" was the rallying cry. The problem is that this kind of transparent portability is hard. Very hard. So hard, in fact, that none--count them, ZERO--of those toolkits survived. (Rogue Wave, a company that acquired one of those toolkits, still exists, and their C++ libraries are still available for purchase, but there's zero new development going on there.) None of those toolkits even attempted to do all the screen-painting natively, either, when complaints that "the GUI just looks wrong" when rendered with native components (think AWT here) came up. The goals of Swing are HUGE.



Swing != Payoff


For just a moment, let's give credit where credit is due--Swing represents a HUGE success, as far as I'm concerned. Sun has created a library that, more or less, does what it's supposed to. Yes, it has bugs. Show me a project larger than "Hello, World" that doesn't. Yes, there's functionality we'd love to have that wasn't there to start (think mousewheel), but Sun has been slowly folding that support in. Themes, portable look & feels, a rich model/view architecture, non-trivial controls (JTree, JTable), Swing definitely hits a triple. It's portable, you can write functionally usable applications using it, and it has a rich set of UI functionality available to you.



But, as O'Hearn notes, Swing is hardly a resounding success across the board. Running on light hardware, Swing crawls--because, in order to maximize its UI portability, Swing has to draw each and every pixel in the window itself. Swing apps "just don't quite look right" to many users--the look and feel just "stands out" compared to other applications for whatever platform you're running, even using the native look & feel for that platform.



Let's not forget that Swing is entirely free--the entire development cost of Swing is a drain on their development budget, with no income to compensate. Frankly, this doesn't make much business sense, unless you believe that people wouldn't use Java if a UI toolkit wasn't available. One is (AWT), and gets people "just far enough" that students and hobbyists you want to build apps with it can do so. If a company wants a professional-looking application, isn't it worth some money to them to get a professional UI toolkit?

Let's also not forget that this race is far from over. Java has had more than five years in which to build a lead against Microsoft, but that grace period is over. Any opportunities to make mistakes and not pay for it are long since gone. From here on in, it's a knife fight. Sun needs to keep their focus tight.



No Swing? No Way


That Java wants a GUI library to ease developer efforts on client-side applications goes without question. As O'Hearn notes, "Sun needs to realize that the Java platform can't survive against Microsoft indefinitely as a server-side technology only". Particularly, as I've already noted before, the "rich client" (as opposed to the browser-based "thin client") is about to begin a renaissance, and full-featured UIs are coming back in vogue. Not having a rich client technology here would be almost fatal, because it will be far easier to go Java-to-Java client-to-enterprise, rather than .NET-to-Java. If .NET WinForms become the de facto choice for doing client-side development (and WinForms face their own adoption curve, make no mistake, so this isn't a guarantee by a long shot), it'll be very easy to give in to the temptation to just go .NET-to-.NET.



That Swing needs to exist is not up for debate. But does Sun really need to be the driving force behind it?



Turn It Loose!


Question: What would be the result if Sun simply turned all Swing development over to the community as a whole?

We've already seen the huge success a number of Open-Source projects have enjoyed in the Java space: Tomcat, Ant, Crimson, Axis, the Jakarta-Apache Group is an amazing collection of people that have created an amazing set of tools and code. (My personal favorites: Ant and BCEL.) It's not unreasonable to assume that the Swing libraries would get good attention once released. It's also not unreasonable to assume that Swing would remain as the preeminent "standard" for developing native UI applications, just as Tomcat and Ant and preeminent "standards" in their respective areas.



What this does most of all, though, is:


  1. free Sun to take those hordes of Swing developers and either contribute them back to the open-source effort (as they did with Tomcat), or move them onto other projects,

  2. bring far more developers into the halls of Swing than Sun could ever hire or pay for, and

  3. earn back some respect from the open-source community that our dear buddy Scott McNealy burned with his comments about open-source J2EE efforts.



These are not intangible benefits, and most of all, seems to represent a win-win for everybody. The Swing Connection could move to jakarta.apache.org, the developers there could become the nucleus of the open-source Swing community, and Swing could "keep up" with platform developments at almost-zero cost to Sun. This sounds like a good result to me....




Thoughts?


15 Comments

venkat_goud
2002-09-12 13:59:27
Take away Swing and Dont let MS enter the servers
I have no great experience with Swing. But whenever there is a need comes up to develop a UI in Java I look for alternatives, mostly I end up doing an HTML interface. While I am not competitive enough to comment on Swing, but I heard from many developers saying that its easy to begin doing swing stuff but to do commercial
quality GUI using swing is a nightmare - bugs and lack of docs.
And lack of good tool support (something like VB or Delphi) makes it even more harder to develop in Swing.If Sun wants Swing to really take-off in a bigway then it badly needs a good IDE...I dont see that happening...


though not directly to related to swing but in general...
Sun should learn from lessons I feel...


1. Understand that everything that is coming from Microsoft is not evil.


While the rest of the world was bathing in SOAP, Sun up until recentl[I think EJB 2.1 has WebServices] did not have anything on that side. By the time they catch up with it others will be miles ahead, but thanks to the support of the open source they will be there.


Look out for the features in .NET and incorporate them into J2EE. There are certainly some good features which Java can use from C#.


2. Recognize the fact Open Source loves Java not because they love Sun but because they love the language.


Scott Mcnealy should understand that if Open Source really supports C# (or Mono) the way they support Java, then Sun (and most Java dependent companies/developers like us) would be in trouble. Its the tremendous amount of code from open source is what proved that Java is actually usable in enterprises- not Hot Java browser.


3. Generic UI is hard.


May be they should completely giveup on this and hand it over to Opern Source as you said!. Native client UI applications have tremendous amount of responsiveness and I dont think Swing can come any bit close to any of it.If there is any "rich client renaissance", even then I dont see Java playing big role there. Swing or Awt are
not the way here...I dont know what...but something else is needed - some combination of native plus Java??.


4. Concentrate on core strength.


If Sun really wants to become profitable [which means they get to spend more money to improve on Java which means we get more cool features in Java]---
Servers and server side technology, both interms of software and hardware has always been Sun's strong point. This is one area where Java definitely has an edge over Microsoft, because the language/platform has enough support and there are good number of free tools to justify the costs. Microsoft is coming from a strong desktop market and trying make forays into server market, Sun should do the reverse - conquer server side first...


5. Follow MSDN kind of structure for documentation and examples This is trivial but very useful.JavaDocs are good but unless you are a good Java developer you will not know where to look for certain things[which packages to look for certain things with so many deprecated API, and so many javax. packages ].
The first problem developers migrating from Microsoft face is the searching for stuuf in the
documentation. Define an interface/format [similar to .chm] to bundle and search docs and let Open Souce
implement it.I am more than willing to do it:-)


6. Tell developers that you actually like them:-) I have seen in more than one instance where Sun (or representatives/specifications) saying something to the effect "if you dont like it then go implement your own". If you dont like EJB's caching/pooling etc...go implement your own.. If you dont like Swing go roll your own! Having a standard is a good thing but with in a standard you always should give enough freedom to
do things differently, if needed.






anonymous2
2002-09-12 17:37:14
and the point is . . . ?
J2EE != server-side Java. Anybody who doesn't see this needs to stop reading buzzword-laden articles on C|Net. J2EE is just an umbrella for a variety of enterprise-focused Java APIS, some good (JDBC, RMI, Servlets), and some bad (EJB - ugh, what's that smell?). It's a marketecture term.


.NET is really the same: a marketecture term. What is it? C#? SOAP? The JVM - excuse me, I guess Microsoft calls it the CLR? One of the variety of applications Microsoft is rebranding as "XXX [Server] .NET"? One thing we can be sure of: like Palladium, large parts of it are still vapor.


Client-side Java: that was just never a good idea. Swing, AWT, IBM's GUI tookit, whatever. Who cares about Java at the client? Like linux, the server is where Java is strong. Enterprise applications are Java's fortress.


Sure, give Swing/AWT to the Java community. Better yet: give Java to the Java community. Mr. Neward rightly points out that the most exciting developments in Java for more than a year now have come from the Jakarta projects. Sun: GIVE IT UP! Let IBM, Oracle, and the host of other companies with an axe to grind against Microsoft help pay for it and steward it. Sun is a hardware company. They've never had success selling software. What, Solaris? Star Office? Keep trying . . . Java? Sure. That'll make money for Sun. Riiiight.

anonymous2
2002-09-12 17:41:45
Buggy prose
Please look up the definition of penultimate in your dictionary.
jmjarrett
2002-09-12 18:51:00
Desktop Java still has a chance IMHO
venkat_goud wrote: "Swing or AWT are not the way here...I dont know what...but something else is needed - some combination of native plus Java??"


Your right! Luckily this "new GUI technology" doesn't need to be invented. It already exists and it is called SWT. It is open source and available under the IBM CPL license and already works on Solaris, Windows, Linux, and a port is happening for Mac OS X. What is so cool about SWT that it is both portable and native (through JNI). I used the new WebSphere Application Studio IDE for almost four weeks before moseying by the www.eclipse.org site where I learn a most shocking fact. WS App Studio is a Java program! It doesn't look like a Java program, it doesn't act like a Java program, and it certainly doesn't perform like a Java program. Prior to seeing SWT in action I didn't think Java had a prayer of the desktop. For what it is worth I've changed my mind. If SWT could be combined with the NetBeans platform Java Desktop applications would become a very real ,not mention smart, reality. YMMV.

anonymous2
2002-09-12 21:55:14
eclipse.org is doing the job...bit by bit
SWT/JFace...
is here to stay...:)
anonymous2
2002-09-13 00:52:10
Jakarta = server
Open sourcing Swing does sound like a viable plan, but as Jakarta are a server-based project it would seem to be a poor choice to run Swing.


More likely a new group would have to organise themselves.

anonymous2
2002-09-13 03:29:36
Alternative approach
This would be a very significant move for Sun to make. Swing is part of
J2SE and as you point out it's a huge and complex part of it. It would
take a lot of faith for them to relinquish control of what is being
distributed as a core part of the product.


I also doubt your estimate of the effort Sun are putting into Swing. The
amount of new work that is occurring on Swing compared to the rest of Java
doesn't seem anything like half to me. Obviously a large library like
Swing will require more bug-fixing attention but even factoring that in I
just can see that Sun are expending anything like half their J2SE effort
on Swing.


Like any large, complex and ground-breaking development no doubt Sun
has learnt a great deal from the development of Swing. They also have
to live with the mistakes that have been made.


You also highlight that Swing hasn't achieved wide-spread acceptance for
GUI development. Perhaps a more productive route would be for Sun to use
the experience it has gained to lead an open-source effort to build a
Swing replacement that would achieve these goals. With such an announcement
Sun could place Swing development on hold and state that it will only bug
fix it going forward.


If they want to go down this route a serious evaluation of SWT should be made
and perhaps they could even consider partnering IBM, along with the open-source
community, to develop a product combining their experiences. (Sounds of content
snoring.)

anonymous2
2002-09-13 05:47:40
the success of Java
Neward's article is excellent. As a fledgling Swing developer (I am 55 years old and just started this business about two years ago) swing fits my projects, but even I know it has problems. Giving it to the community is a great idea and would most probably help everyone involved. Many of my clients are leaving MS because of the pricing, being held hostage by the company, and the security issues. Star office is replacing MS office, IIS is losing to Apache, and linux is becoming the OS for the servers.....Sun needs to regain their focus, support this move and the industry will be better for it. One bit on the soap box....linux needs a desktop application...then my customers can have the whole package....


Great article...great ideas...

alexmoffat
2002-09-13 08:04:39
Open Source Swing - No. More Open Source Server Side - Yes
venkat_goud who says "I have no great experience with Swing" writes "but to do commercial quality GUI using swing is a nightmare". I'd take exception to this. I've developed commercial quaility GUIs using Swing, so I think I know what I'm talking about, and it's no more difficult or buggy than using any other GUI toolkit.


I think also that you're overestimating/misunderstanding the difficulty of the Java docs situation wrt .NET. .NET may look simpler now, but Java looked pretty simple in 1997 when there weren't many packages. Unfortunately, from some points of view, Java has grown now to solve many problems. Often this has required new packages. If I was starting from scratch to learn Java now it would certainly look pretty intimidating. This is one reason new languages and techniques can take hold, they initially look easier and the programmer can grow along with the language.


As for the idea of open sourcing the Swing code I think the problem would be that while open source development has worked for server side code it's not exactly proved to be a resounding success where UIs are concerned. The normal approach, and I'm only slightly joking, seems to be to first add a skinning system and then make everything into a user option. Gnome and Kde aren't noted for the excellence or innovation of their UI work (recent improvements seem to come from heavier Red Hat pushing). Programming GUI code is fiddly, very detail oriented, and sometimes boring work. It's much more difficult to find people who can do it well, and like to than to do it, than it is to find people who like to program the broad brush strokes of server side frameworks, where java open source has currently worked.


Sun needs to push harder to maintain it's server side lead, open source can really help here, as it has in the past. In fact I'd vote for more support from Sun for server side open source rather than causing confusion and disruption in the market by "dropping" (which would be the MS spin) client side java. If we're really in a fight we should concentrate overwhelming force at the weakest point of the enemy's line while avoiding uncovering a flank for them to attack us.

rdilipk
2002-09-15 07:19:47
Buggy prose
Why? Are you championing the world-wide adoption of that word? Well I did and I dont see anything wrong with his usage. Ted, maybe, wants to convey that Swing is NOT the ultimate - yet.
gerald_bauer
2002-09-15 13:52:59
Java Will Conquer the Desktop Thanks to XUL and Web Start
Evidently you (Ted Neward) have no clue what you are talking about and missed this year's and last year's news while pushing Microtanic .Nyet and schmoozing in Redhell.


Java's comeback on the desktop doesn't rely on Swing. Swing is just another GUI toolkit along with Eclipse SWT, Gnome GTK+, Trolltech Qt, Windope Forms and so on.


Instead of locking yourself to a single vendor by using one of the many archaic GUI toolkit APIs use XUL (XML User Interface Language) along with XHTML (for styled text in XML) and SVG (for 2D graphics in XML) and CSS for styling and use Web Start (for app startup in XML) for secure, single-click installation magic from any browser from anywhere (that is, any web server).


To see the future today, check out Luxor - a GPL'ed XUL toolkit in Java for Swing and SWT built from the ground up for Web Start's auto-install, always-up-to-date, single-click magic - online at http://luxor-xul.sourceforge.net

anonymous2
2002-09-16 10:49:17
Quick blog summary
Java hasn't been successful in any development area; thin client, thick client, server or embedded. We all know that EJB is a miserable failure. Microsoft is going to eat our lunch on the servers because they took the sensible position of actually using SQL in a reasonable manner, so their performance on average kicks butt all over EJB.


Please someone from the successful Open Source world please come and save us before Microsoft turns Java into a historical footnote.

anonymous2
2002-09-19 17:38:23
Open Sourcing Code != Success
Why do people continually insist that code should be open sourced so that it can become successful? Sounds like a "grass-is-greener" argument to me...
phuego
2002-11-11 21:52:06
agree with the article's conclusion
thats a good article.
I have spent much of the last 2 years developing rich Swing based GUIs for fat client type applications - and although initially I thought Swing bit... now that I have learnt some of the detail - it is my preferred choice.
anonymous2
2003-03-28 09:38:39
100% Java Alternatives to Swing
http://opendoors.com/conga
There are 100% Java alternatives for building robust, efficient, and screaming all-Java GUIs.