Swing
How many times have you opened a book in search of a solution and found not only an answer, but also an elegant enhancement to your application? How many times have you ignored an O'Reilly book on the same subject lying on your table? The answer is Manning's new book Swing authored by Mathew Robinson and Pavel Vorobiev. And that is my final answer.
The book (with just a 5-character title) is 917 pages long and is divided into four parts containing 23 chapters, an appendix and a bibliography. The first part, "Foundations," introduces Swing, its architecture and the key mechanism underlying Swing. Part II, mysteriously called "The Basics," explains the most commonly used and simpler classes of the Swing toolkit like labels, buttons, menus, list boxes, progress bars and sliders. The third part of the book, "Advanced topics," deals with using complicated components like trees, tables, text components and layered panes, as well as creating pluggable look and feel. The final part, "Special topics" introduces printing and the Java2D API.
Only two chapters of the final part are included in the book. The remaining four chapters which discuss accessibility, JavaHelp API, CORBA and some examples contributed by experienced Swing developers are available on the book's Web site.
The structure of each chapter is the same. Let's look at the chapter on tables as an example. The JTable class is introduced followed by related classes and interfaces. This is followed by discussions on row and column selections from JTable, column width and resizing and customizing the appearance of the table. The important methods related to these issues are discussed and short code samples are used to demonstrate the main features.
Then comes the meat of the chapter -- the examples. The first example shows how to display stock market data in a JTable. Complete code for the example is given and important sections are discussed. The examples that follow are enhancements to the first example. In the JTable chapter, they include adding custom renderers, customizing the data rendering, retrieving and displaying data from a database.
Each of the examples builds upon the previous one and as promised on the cover of the book, is production-quality code. While most other Swing books serve as expensive javadoc dumps of JFC with trivial, forgettable examples, Swing provides code that saves lots of time for the developer. The other applications that are developed in the book include a JPEG image editor, an ftp client, an X-Window-style desktop environment and a word processor.
This book is for the developer building applications using the Swing components of the Java Foundation Classes. The large number of examples make this a great cookbook providing code samples that will vastly reduce your development time. The language is simple and the examples are well defined. All the Swing components are discussed in detail with several screen shots.
The part I liked the most in this book is the section in each chapter about extending the Swing components to create custom components. These include creating an oval shaped border, polygonal buttons, and a tabbed pane which takes an image as the background. These examples provide knowledge to extend the components in ways limited only by your imagination.
The book is sprinkled with UI design guidelines by David Anderson related to usability and presentation. There is no reference to the Java Look and Feel Design Guidelines issued by JavaSoft. So I would recommend referring to that book (published by Sun Microsystems) if you want to design applications with consistent appearance and behavior.
The only minor annoyances in this book are the figures which display the component hierarchy, as they have an unprofessional look. But there are only a few of them.
To summarize, the unique examples and the exhaustive coverage of Swing makes this book very valuable for both beginners and advanced programmers.
Purchase this book at ThinkGeek.
Hi, I'm a java programmer and a snow boarder. The connection between these two passions is this. I first hit the slopes as a skier and programming in Basic, Scheme then c++. Neither were much fun for a beginner.
It is pretty hard to find a really good skier. Although a lot of skiers are good at something, few can do it all moguls, speed, techniques, etc... Same with C++, I know a lot of programmers but very very few good C++ programmers. Also most good C++ programmers are very specialized. For instance, I know a great graphics programmer but building a multi-threaded server was a huge challenge for him. He spent a lot of time reading up on pthreads. Also until you are a good skier or C++ programmer you don't have much fun. You are constantly hampered by lack of technique and cognitive overload. Too many things have to come together before you advance.
Now snow boarding was different. I picked it up very quickly and most importantly I had fun while I was learning. Java programming is very similar. Although learning to build a simple programming in Java and C++ is an equally challenging endeavor, advance programming is where java really shines.
In java building a multi-threaded server is pretty simple and adding checksum and compression is a breeze.
I have found with java the details are easy enough that I have very quickly start advance software design including design patterns and using concepts like Polymorphism and synchronized where they really pay off.
So I am a firm believer that Java's popularity as a programming language will continue. People forget, that enterprises would not touch 'C' until it had been around for a decade. Java is not even close to the 10-year mark and is very popular.
Finally the VM architecture is given unfair critics. Check your basics there is no theoretical basis why compiled code is to faster than interpreted. So yes in theory interpreted VM can be just as fast a compiled code!!
Forgive me if I've got the wrong end of the stick, but I was under the impression that Java had had its day and was pretty much on a downwards spiral. The basic premise of Java was an interesting one, and it was released at the best time for it to succeed, but due to various factors it hasn't, and there are few web sites where it is used.
Java was a great chance to make a C++ that people could understand without going through the mental contortions that currently plaugue it. At first glance it looks a lot nicer, but when you take a closer look it is just as bad, but with long keywords rather than obscure symbols. When you have classes peppered with "abstract", "final" and so on, and methods with "synchronized" etc. you start to wonder what exactly all this "synchronized final void foo()" is all about.
All the websites I've seen have eschewed Java in favour of CGI scripting, a more reliable alternative. Writing an application in Java requires the use of the Java libraries, which involve some pretty bizarre methods of working for anyone used to another language.
While I appreciate there are some "hardcore" Java programmers out there, can anyone point me to a real-world application or website that actually uses Java? I mean properly, not just a tiny applet showing the time or something.
Cisco's CiscoSecure... There's a [multiple expletives deleted] JAVA craplication between the ACS server engine (C++) and what ever database one has setup (Oracle). That JAVA craplication is slow and easy to screw up -- it stops answering; the authentication server stops. What's worse, it's using ODBC to talk to any database. (Instead of learning use a database, they stick some damned JAVA in the middle. And the bad news: it has no security to speak of, nor does it log hardly anything.)
There's Sybase's SQL Anywhere. It's JAVA (or was a few years ago.)
You might also be surprise to know Star Office is written in JAVA.
(Yes, there are OCI based JDBC drivers from Oracle, but they were not installed/selected.)
This isn't a troll; I'm seeking to educate myself.
I have had a number of encounters with Java-based GUI applications, and to a piece they have all been bad. All the Java GUI applications I have tried have been sluggish, unresponsive, and generally unimpressive.
They all seem to want to install their own JRE too, so it seems like I (as a user) am being punished because the Java compiler couldn't/wouldn't generate a native binary. But yet I have to install a native-binary version, because it installs a native-binary JRE as part of the package.
I have nothing particular against Java as a language - I don't like Bondage & Discipline languages myself, but language choice is very much a personal thing, and I don't presume that my personal preferences are best for the entire world. But Java as an implementation - as I have seen it - provides a really nasty end-user experience.
Ever tried the Netscape 4.1 Admin console? Bletcherous! Horrible! Nasty! Yechh!
Is anyone out there deploying Java applications with good results? Really?
Want to learn about race cars? Read my Book
The MS analysis does not give very good technical reasons for the delegate. There are also numerous inconsistencies between the points they make, which are typically done to skew the reader's perception in favour of delegates.
Examples: They compare the number of "classes" used in the AIC vs. delegates case. (22 vs. 1) Yet they ignore to mention that delegates are actually classes under the covers (therefore, the answer is 22 vs. 22).
That AIC's need to be compiled in advance is rather irrelevant unless you are concerned about a 2-3% development footprint hit.
They also ignore that with some simple reflection, the number of AIC required for event handling can fall dramatically.
The source code differences are 9279 bytes vs. 10842. That's a difference of 1600 bytes, mainly from AIC syntactic-junk.
MS claims that delegates can be portable. That's nice, but that also means the onus is on MS to submit it to the Sun community process.
The multicast arguments are equally skewed. So because some events may be multi-castable, that justifies the usage of a non-standard construct that works just as well as AIC's, is just as fast, and has a slight flexibility advantage?
And based on my experiences on a 6-month WFC project, delegates are decent, but I see no real benefit of them over AIC's other than the class footprints (which again can be alieviated through judicious use of reflection).
-Stu
If you know how it is implemented in Java (or know of a link to a description), then I would love to hear it.
Enhydra is an Open-source Java app-server:
http://www.lutris.com/EnhydraQuotes.html
I don't know exactly what they have built, but it's using Java.
"Eye halve a spelling chequer, It came with my pea sea, It plainly marques four my revue, Miss steaks eye kin knot sea"
IBM's San Francisco:l ?tag=
http://www.ibm.com/stories/1997/07/iw3.html
http://news.cnet.com/news/0-1003-200-320747.htm
Also, If Java is "useless" why is there so much work being done on integrating Java with Apache? Chack out java.apache.org. What are all these Java application server vendors doing? They have to be using Java for something.
"Eye halve a spelling chequer, It came with my pea sea, It plainly marques four my revue, Miss steaks eye kin knot sea"
no need for hotspot, you can already do some kind of debug code without a need for a pre-processor.
// blablabla
class MyClass {
static final boolean debug = true;
public void mymethod() {
if(debug) {
}
}
}
want to disable all the debug code? just change the debug boolean to false. next time you'll compile, it will not compile the condition code, because since debug is *final* and set to false, he knows that this condition will always be false.
Our development group (which does hard core ActiveX controls and servers in VB 6.0) has always gotten this comment from people who don't understand VB. Without exception, if something performs poorly in VB it's because they're trying to do something VB wasn't designed for (3D gaming calculations anyone?), because they're programming it poorly, or because they're simply trying to do some pretty complicated database stuff (which should almost always take place in server side procedures).
Small comfort I suppose, but VB'ers had to go through the same thing. I suppose C++ had this curve too. History repeats itself I guess.
Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
I assume there is a way to produce PS in Java. Which?
I want (to find or make) an UMl drawing app in Java... Where?
Sorry for OT.
I think, therefore thoughts exist. Ego is just an impression.
... if you thought that you have to write your own event loop. AWT nor Swing expects you to write an event loop like you had to do with (non-Motif) X apps !!! What where you doing ?!?!?!?!
- sigs are for wimps.
It makes the tagged method a critical section. It's that simple. You say synchronized void foo() and it (JVM) knows it's a CS. No mutexes, no waitfors, no nuttin.
-- What you do today will cost you a day of your life.
Or is GUI programming in Java much like banging one's head on the wall? I tried doing some a little while ago, and the documentation is almost useless - you have to manually set up your event loops, and in addition to that, it's horribly slow. A 100-line swing application (3 buttons and 1 messagebox) takes about 10 seconds to load, and there are noticeable slowdowns - and I have a Celly 366 w/128MB RAM.
I could probably write the equivalent program in QT/C++ in about 30 lines. Is it just a problem with swing (the API is very unpleasant), or is Java in general bad? I would have expected it to be reasonably fast on my system - but using JBuilder Foundation is terrible (click on a button - wait 3 seconds). And it's not RAM usage either - it was completely unusable with only 64MB RAM.
Why not do this:
NATIVELY compile code for platforms that support it. For those that don't, use bytecode. I'd guess this could get a MAJOR speedup.
1) Compile once run anywhere is not as important for where java is heading (server end). Please stop insulting us, and give us a native compiler sun. We are capable of compiling to bytecode when we want to use applets on webpages (noone does that anymore tho :P).
Get TowerJ. It compiles. It runs on Linux. Sun doesn't provide it, but I thought that /.ers whined when everything came from one source...
2) Give me paramterised types or templates. Writing our own collection classes and/or casting really really sucks. Some of the stuff that the folks who wrote Pizza are cool, anonymous functions for java :D! (basically lambda expressions) and parameterised types. It's even compatable with current virtual machines, just most IDEs and compilers won't like it.
It's coming. The people who designed Pizza have now designed GJ, which is going to be incorporated into some future version of Java. In the meantime, you can download the GJ compiler (and a java.util package that has been modified to work with GJ) right now.
3) Delegates, I want MS 'delegate' style function pointers in java. Anonymous Inner Classes are horrific, and spoil Swing.
Delegaes sucked. Furthermore, delegates just compiled into anonymous inner classes. No gain, there.
4) ASSERT. We need asserts!!!! Lucky J++ has a simple preprocessor. So many bugs could be caught if people used ASSERT more, Sun don't even think we need them!
Sadly, ASSERT is coming to Java. However, it's a bad idea. Cafe au Lait has discussed why this is a bad idea in the past.
In the meantime, you can write your own assert facilities. Programmers at my company did so. It'll catch problems at run-time, not compile-time, which is how I remember ASSERT working, but it's been a few years.
Anything else?
-jon
Remember Amalek.
Awwww.... yet another /.er who whines when other people make them pay for their work. My heart bleeds for you.
Sun is not being stupid over the JVM. They release a reference JVM. TowerJ has written a Java->Native compiler which must include a JVM of sorts as well (things like dynamic class loading and reflection still need to work).
2) Templates are still "coming" (and have been for a while). Sun have been saying they'll integrate pizza features for over 2 years.
You have this pathetic fixation on having Mommy Sun give you all your software (and for free!). Go to http://www.cs.bell-labs.com/who/wadler/pizza/gj/in dex.html and download GJ. Use it today.
3) Delegates rock. They use classes, NOT anonymous inner classes (get a clue). They have the same overhead as making a function call - unlike AIC.
Horseshit. Tell me how, in 20 words or less, Microsoft implemented first class function pointers without violating the Java Class File Format. The article from Microsoft's Java architect has disappeared from their WWW site, or I'd pass on a link to it to you. He says that delegates compile to anonymous inner classes. What, you know better?
Here is Sun's analysis of delegates: http://java.sun.com/docs/white/delegates.html The analysis of how MS implemented delegates is given in http://java.sun.com/docs/white/sidebar.html
Yes, there are ways to hack ASSERT into java, but it usually involves using an if statement so the compiler will weed it out, rather than a simple "Assert" statement.
If you knew about HotSpot, you'd know that if branches that aren't ever taken will be compiled out. And since we're talking about long-running server processes (remember your whining about native compilers?), HotSpot's adaptive compiling is perfect.
-jon
Remember Amalek.
For MS to claim that Gosling is wrong and delegates generate classes rather than inner classes is just spin. There is still going to be some sort of intermediate class automatically generated with a computer-generated name. What's the difference between that and an anonymous inner class? Nothing. What is the performance advantage? None. What was the point of delegates? Yet Another Pointless API Change for Lock-in. Yay Microsoft. I reiterate my original point: Delegates suck.
-jon
Remember Amalek.
In fact, this is similar to what I do in my own code. I take it one step further. I put the boolean in an interface, which is then implemented by other classes. That way, I can switch on or off debugging at compile time by changing the value of one debug flag in one interface.
public interface Debug {
public static final boolean _debug;
}
public class foo implements Debug {
public void baz() {
if(_debug) {
}
}
}
public class bar implements Debug {
public void boo() {
if(_debug) {
}
}
}
(As an aside, any field in an interface is implicitly public static final. But I like to make things explicit.)
-jon
Remember Amalek.
Java needs the following features to satisfy me:
printf
Radix support for byte and short
A replace(string1, string2) method for strings
A windowing toolkit that doesn't eat all my swap space (unlike Swing)
Glückwünsche, haben Sie Slashdot ermordet, indem Sie zum korporativen Druck beugten und Subskriptionen einlei
That's just fine... IF YOU USE WINDOWS!
:-(
Meanwhile, the rest of us have to sit here as Forte takes 10 MINUTES to load and another MINUTE to respond to menu selections, meanwhile eating 150 MB or so of swap space.
Glückwünsche, haben Sie Slashdot ermordet, indem Sie zum korporativen Druck beugten und Subskriptionen einlei
The problem is that your metric is faulty.
Shipping products don't necessarily equate with wide usage. From the people I've talked to in the industry (and they represent a fair cross-section), Java is used overwhelmingly for internal use. Those coding efforts will never see the light of day publicly because they represent specific solutions to a specific internal problem. Many organizations use Java as sort of a glue-all; where Perl is considered the duct tape of the Internet, Java is more like a set of schematics and a trained team of engineers - Perl gets the job done, but Java can get the job done *right.*
What you're trying to do is equate Java's acceptance with the level of shipping products based on the language. Where your metric falls down - and will fall down with any language or utility - is if that language or utility isn't used in products that you can buy off the shelf. Java isn't used in many shipping products because it isn't suited very well towards client applications. Where it IS suited very well is on the server - a place of use that you miss completely by asking only for shipping products.
You and I seem to be talking past each other.
>If Java is so great at creating the programs that fill these niches, why is no vertical market app vendor shipping a Java product to do so?
Asked and answered. These niches that you refer to are inherently specific. While you can lump them up and say, for instance, "servlets for accessing a database," the particulars vary. Company XYZ may require an *entirely* different servlet than Company ABC, because of the configuration of their database, how they intend to access and display the retrieved data, and any number of other variables. Company XYZ could package that up and ship it, but it would be doubtful that anymore than a handful of other companies would find the software useful without serious modification.
The next step above that would be to sell a generic servlet. But again, you run into the configuration issue. How much do you have to architect the servlet before it becomes applicable to more than a small handful of situations? How bloated does it have to become to encompass the vast variety of configurations out there? Many corporations would find it easier to simply write their own from scratch, ensuring that the servlet would be completely designed for optimal performance for a particular configuration.
As a result, much of the Java work that is done is done for company-specific purposes, and is not sold or otherwise distributed because it would be of extremely limited value to others without the source code to modify. It would be like the United States trying to sell the programming instructions inside a Patriot missile. Unless you *have* a Patriot missile (raise your hands, please) the code isn't going to be of direct value to you, and if you happen to have another type of missile, the Patriot code isn't going to work without serious modifications.
If you want to see what exactly is being shipped, I suggest you look at Java Solutions Marketplace, where you can browse through the Java-related products and services to see whether anything qualifies for your stringent criteria.
>The only possible exception to the above are problems so crazy and stupid (and small) that no sane company would make a product to fix it.
You seem to want Java products that you can walk into a store and buy. It doesn't work like that. Should I dismiss Perl because I can't walk into CompUSA and buy a pure Perl software package? Perl has it's place as the glue that holds together the web. Java also has it's place in the software world - it's just not the visible, retail shelves that you are so desperate for.
>Now we're back to non-real-world uses.
I'd be interested in seeing how you define non-real-world uses. If it optimally solves a problem for a company, as far as I'm concerned that IS a real-world use (and is a much better real-world-use than some generic packaged product that has to be shoehorned into being merely an adequate solution).
Interestingly, earlier today a group of sales guys from the company the book's authors work for (according to the ad at the top of the book's homepage) gave me a demo of some of the Java apps they sell. They are using Java for both back end stuff and client apps. I must say that I was highly impressed with both the appearance and the performance of the client apps. I am assuming that the authors had some hand in the coding. If so, I for one am willing to listen to what they have to say in their book. They seem to know what the heck they are talking about, unlike some other books I've wasted good money buying. (And perhaps unlike _some_ of the folks posting to /.)
cheers!
iceaxe
WALSTIB!
There is nothing new under the sun (no pun intended). Most (all?) "specific internal uses" are actually a "niche markets". If Java is so great at creating the programs that fill these niches, why is no vertical market app vendor shipping a Java product to do so?
The only possible exception to the above are problems so crazy and stupid (and small) that no sane company would make a product to fix it. Now we're back to non-real-world uses.
--
Linux MAPI Server!
http://www.openone.com/software/MailOne/
(Exchange Migration HOWTO coming soon)
OK, so let's hear those examples. In what real-world, in-current-production systems is Java being used.
--
Linux MAPI Server!
http://www.openone.com/software/MailOne/
(Exchange Migration HOWTO coming soon)
You might want to check TogetherJ:
They have a free(feature limited) version available
The site is http://www.togethersoft.com
Otherwise, dia from the gnome project is looking really good, even if it's not Java...
In this context, "lightweight" means that the components are completely defined in java. Swing components are lightweight because they use the java paint() method to draw themselves on the screen.
awt components, on the other hand, are "heavyweight". They have an operating system peer that defines their behavior and appearance. java.awt.Button, for example, looks different in windows that it does in Motif, because the actual button is created by an operating system call.
With Swing!, all the components look the same regardless of the underlying operating system. This is a good thing (most of the time).
Mike
Its not the inheritance, it's the MVC architecture. Every time you create a simple JButton, it creates a bunch of objects to describe the layout and functionality. While this is incredibly customizable and flexible, it also makes the the whole thing slow.
:)
1.3 should be better, but last I checked the only version out was for windows. This is a temporary lag while they consolidate the Solaris builds, but it still keeps me from trying it out.
BTW, Swing! keeps getting faster and faster. When I was using the original point releases, it was much slower than it is now. As it is now, any pentium 2/celeron type machine should be able to draw swing components pretty fast. Almost as fast as native code. If your app is slower than that, then you are probably doing something wrong.
Or using a builder tool, instead of doing the layout work yourself.
Mike
ufdraco wrote: "Prices can change, and this review gets archived. The two don't really work well together." Good point; the currency would definitely fade. But, I see nothing wrong with a data point here, like "As of 11th March 2000, this book cost $40 plus shipping at Thinkgeek." (Or other vendor, too of course.) Looking back at the archive in 90 years;), someone could know how much a book /had/ cost. And in the more immediate future, the book prices (unless remaindered or superseded by a new edition) are likely to be at least approximately right, eh? timothy
jrnl: http://tinyurl.com/c2l8yr / foes: http://tinyurl.com/ckjno5
Ah. Yeah, I can't think of a single Java applet we've sent out onto the web. We have one we use internally for displaying hierarchical, expandable lists, but that's mostly because it was simple, free, and we're lazy when it comes to internal websites for some reason:>
Okay. Your post confuses me. In one breath you seem to imply that no one should use Java for web applications and in the next breath you say its a good idea. I can tell you as a professional web developer(who regularly uses ASP, perl, PHP, and Java in the course of his job), that (a) being a professional web developer does not merely involve being able to hack together some HTML and/or javascript and (b) We're using Java Server Pages more and more for our new projects. Its a wonderful technology, as far as we are concerned.
Moderate this up! Thanks Atheist, I was thinking of getting it but did not have the money!
"i think most sane people would concede that the shuttle launches are the most successful NASA endeavours"
They're very succesful at being useless and setting back the development of a real space program by at least 20 years.
Bradley
Price can change, and this review gets archived. The two don't really work well together.
ufdraco
Yes, well you could do the same thing in VB in probably half the time, and it would run 10 times faster.
Not that I like VB the language over Java...just putting things into perspective.
BTW, I'm not an MSCE, and I am a computer science undergrad at a unix based university.
swing is definately here to stay as far as java is concerened. it,s lightweight component set eliminates the problems the awt had with peers now once the performance is up to snuff....
Light weight? I don't think there's ever been a toolkit that's as heavy weight as Swing.
Swing is easish to learn, the object hierachy is pretty good, but the speed and memory usage is horrific. The average swing application uses more memory than Windows 2000 in total.
BTW, The even handling is TOTALLY SCREWED.
Anonymous inner classes? PULEEEASE. My HCI professor thinks it's one of the worse ideas ever.
Why don't sun JUST ADMIT that Microsoft's java delegates (function pointers for java) were a good idea and implement them. Saying delegates are not object oriented is like saying that methods aren't 'object oriented'.
Next time click the links before answering...
Java web pages serve faster than anything script based except mod_perl because they are memory resident via the Virtual Machine while CGi has to be read from disk. So the 10 times faster crack is simply bullshit. . Secondly why did you assume I meant I was using Windows?
Um, it will run 10 times faster. Put together the DB stuff with VB data designers, then write the web stuff using vb webclasses (compiled native binary code).
It's (mostly) not script based. The only script is some ASP that passes everything to the VB webclass.
I didn't assume you meant windows, was just talking about the speed of being able to put something together
If you aren't using windows, then I have no problem. Well I have no problem with using java for serverside stuff on Windows either.
What I said wasn't meant as an attack, just a comment.
Been reading Sun propaganda again?
Get it the truth about delegates from the guys who invented it.
blah
It's defintely done with classes, cause you can see the class files it generates.
I love these kinds of posts! Ignorant, bigoted people who haven't done any research...
Take that advice yourself. Firstly, NONE of these are available from Sun, like I said, 3rd party stuff that's not widely distributed is useless.
1) TowerJ is not free. And I was talking about sun stop being stupid over the JVM.
2) Templates are still "coming" (and have been for a while). Sun have been saying they'll integrate pizza features for over 2 years.
3) Delegates rock. They use classes, NOT anonymous inner classes (get a clue). They have the same overhead as making a function call - unlike AIC.
4) Why are asserts bad? You have GOT TO BE KIDDING ME.
Yes, there are ways to hack ASSERT into java, but it usually involves using an if statement so the compiler will weed it out, rather than a simple "Assert" statement.
I DON'T THINK SO.
Almost all of VB's objects are written in C++, and VB itself has been natively compiled since version 5.
I think the notational advantage is the best of all.
My HCI professors bawks at AIC cause of how ugly they are. People usually end up using AIC and making it just call a function.
It makes thing MUCH clearer about what is done, and code is well organised.
But I guess I can't expect Sun to respect people who want good looking code - code anyone can read (after looking at their source code, their source code commands, and their notational style).
Never found a good book on UML? There are plenty. The best examples I know of:
Fundamentals of Object-Oriented Design in UML by Meilir Page-Jones if you want a refresher on OO along with a good UML intro (enough UML there for most projects).
UML Distilled by Martin Fowler.
The Unified Modeling Language User Guide by Booch, Jacobson and Rumbaugh.
My blog: http://jkratz.dyndns.org/~jason/blog/
Shit, then, I must be working in a graveyard because I am a java developer who is working along side 8 java developers and we are actively looking for 5 more java developers. Java is not dead, it has just moved to the server-side
When you say things like that with no supporting evidence, it only makes *you* look silly.
...
You have it exactly backwards, you know - it really frees the programmer to do interesting things.
I've read your reply several times, but haven't found your supporting evidence. Did you forget to include it?
*sigh*
I'm back from school and can see your're still posting pro-MSFT drivel without due consideration of the facts. I have 2 friends who will be on the Visual Studio development team in the summer and even they do not take liberties with the facts like you have just done.
In a 3 tier app (DB, middleware, web) the speed bottlenecks are a.) the amount of time to do reads and writes to/from the database b.) the amount of time to send data over the network. Even if VB was 10 times faster than Java on the client (which is a bold faced lie in this age of Just-In-Time compilers that convert Java to native code) the two aforementioned bottlenecks will reduce the speed level of the entire application so that the difference between VB and Java implementations is negligible.
PS: With regards to speed of deployment, there is no contest, Visual Basic is king.
Quoting the late Francis Vincent Zappa:
"Java is not dead, it just smells funny"
Je t'aime Stéphanie
JavaScript was renamed from LiveScript to ride on Java's popularity
--
M-x all-hail-emacs RET
ARGOUML is one option I guess for UMLdrawing app in Java. Look at http://www.argouml.org/
for more info.
/Adam
Hello, I'm Vlada .
On the other hand, the lot of us should have known better than to fall for the easy promises Sun was offering.
Java is just another language, with its own niches. These niches are primarily in the enterprise application logic market. Thats my fancy term for "people who aren't hardcore programmers and who would be using VB otherwise".
For these people, Java is probably just what the doctor ordered:
- there are scads of training materials cheaply/freely available
- there are development kits available for most platforms
- java reduces the degrees of freedom for the programmer, and makes programming more pedantic and verbose...but for less advanced programmers, this is likely beneficial
- sun works fairly aggresively to integrate java in with new technologies, which satisifes IT directors
the list goes on...needless to say there is a market for this tool. Of course if you are a crack C programmer, Java is probably a joke - just as much as VB, and you'd be silly to bother with it unless required to. Unfortunately, Sun has not marketed Java as a niche tool but as the be-all-and-end-all programming language, and hence this spurns a great deal of hostility from folks who know better.Of course, in all Real Life projects, there are lots of developers working on various parts of a project. You've got to be *extremenly careful* while making a C based application with lots of developers, as there are an incredible amount of gotchas that can sneak up on you.. Spending days to hunt down an obscure but critical memory leak costs money...
Java is more strongly typed, and the built-in GC makes that memory leak less critical (yes, you can still cause leaks in Java, but they typically won't kill you like they will in a non-GC environment.) These types of features make it much easier to develop a large application with a teams of programmers with various skill levels and backgrounds.
Please don't compare Java to C++. It's not a simple vtable pointer.
Matt. Want XML + Apache + Stylesheets? Get AxKit.
All I can suggest is you use the source. ;-)
Seriously, I bet you could probably find something out there by either doing a search, or subscribing to Java Developer Connection (at java.sun.com).
Matt. Want XML + Apache + Stylesheets? Get AxKit.
The problem is swing is slooooow. Try a large-ish GUI written in swing. The inheritance depth in Swing is just too deep to make it fast enough for lightweight GUI components. Try it on a slow machine without JIT to see what I mean.
Personally I think this is a real hinderance to Java mainstream acceptance. I've tried a number of XML editors written in Swing, and just went back to Windows or X editors instead, because quite simply they respond. Even Tk apps respond better than Swing apps, because the widgets are implemented in C, not in Java with a huge inheritance tree. Interestingly I fear this will be the same problem that Mozilla and XUL face.
Matt. Want XML + Apache + Stylesheets? Get AxKit.
My work development box is a PII-266 with 128MB RAM. I'm developing with JDK 1.1.6, 1.2.2 and 1.3 in JBuilder 3 Pro. My backend is Oracle 8i on and RS/6k.
No problems.
Yes, the UI take a while to instantiate all the objects and do all the needed set-up; I thread off an animated splash-screen and no one is the wiser that it's actually working.
Once there, the app is crisp - the slowest part is the network connection to the server. It's not as fast as C or Delphi apps, but then again, it was a piece of cake to develop the UI.
I don't know WHAT you might be doing that's so slow, but that is not my experience. Maybe trying to use Java like it was C? Comparing strings char by char? Creating new objects all the time instead of using available references? I'm not trying to pass judgement in any way - it's just that I've seen people try to use a pipe-wrench as a hammer before, and complain of bad performance.
For the record, 1.3 includes HotSpot. That made a difference. Using Swing rather than AWT, and not mixing the two, made a difference. Understanding the memory settings on the JVM - so the garbage collector isn't invoked too often, made a difference. These things help in programs larger than what you describe, but maybe JBF isn't getting started with enough JVM memory?? Just a thought.
-- What you do today will cost you a day of your life.
And it is. By "lightweight," Sun means that Swing components are not using native resources, but are drawn using Java only (no peers). This isn't strictly true for all Swing components (for example, JFrames need to be real frames at a certain level and popups that extend past the edge of the window need to be heavyweight to be drawn outside the bounds of their window.), but it's close enough to be approximately true.
If a 4-page cheat sheet can't cover more than 90% of the things one usually needs to do in GUI coding, the package is badly designed anyway.
As far as API size, Swing was NEVER intended to be small. It has over 2 dozen different widgets! It includes an HTML and RTF parser! A 4-page cheet sheet isn't going to cut it for anything but the very bare minimum. You couldn't adequately describe the functionality of a JTable with 4 pages. If you want bare minimum in Java, stick with AWT. There you only get a few widgets.
I tried Swing once, but discovered it was both slow and not yet widely deployed in browsers. But that was six months ago. Have things improved?
Swing in browers isn't going to be common, probably ever. You'd need the Java Plug-in installed to use it, and the vast majority of users currently have about a 28.8 connection. The 8MB download for the Java Plug-in isn't going to cut it. That's OK, because Swing functions best as an in-house, cross-platform VB app builder. Commercial apps on the order of Word or Photoshop couldn't be built in Swing right now. That doesn't make Swing useless, though.
-jon
Remember Amalek.
-- Light weight? I don't think there's ever been a toolkit that's as heavy weight as Swing. --
Apparently you have never used the AWT, Swing's predecessor.
I'll admit Swing isn't the fastest and doesn't have the smallest footprint, but it is a big improvement.
Do you even know anything about perl? -- AC Replying to Tom Christiansen post.
... at least at Amzaon.com, 40 at ThinkGeek (who don't seem to have a site search engine at their introductory page; argh). Not that the price was unusual, but it should be part of the review IMHO. The price still makes a difference for some of us...
I know of several multimillion user sites which run their core functionality using Java Servlets. As far as I know, Amazon.com is based on Enterprise Java Beans. EJB is an ultra scalable (horizontal) technology. Applet's are kinda dumb, agreed, but server side Java rocks.
Unable to read configuration file '/bigassraid/htdig//conf/14229.conf'
Geocrawler error message.
<META NAME="Generator" CONTENT="Microsoft Word 97">
And the table tags are so broken that Netscape Communicator 4.7/NT won't even render it. You have to use Exploder.
It sounds like a nice book, but it's like the saying: if you like sausage, don't ask how it's made.
--
This is not my sandwich.
Java won't ever replace C++ for me until some huge improvements are made.
:P).
:D! (basically lambda expressions) and parameterised types. It's even compatable with current virtual machines, just most IDEs and compilers won't like it.
:).
I'm actually quite worried that since Sun essentially 'controls' everything, noone else can make extensions that become popular enough to become part of major IDEs. (IDEs with intellisense rocks).
Here's what java needs.
1) Compile once run anywhere is not as important for where java is heading (server end). Please stop insulting us, and give us a native compiler sun. We are capable of compiling to bytecode when we want to use applets on webpages (noone does that anymore tho
Don't sun realise a lot of people don't like java cause of how bloated and slow it is?
I can live with compile once run anywhere, but for speed's sake, let us have the option of write once run anywhere.
2) Give me paramterised types or templates. Writing our own collection classes and/or casting really really sucks.
Some of the stuff that the folks who wrote Pizza are cool, anonymous functions for java
3) Delegates, I want MS 'delegate' style function pointers in java. Anonymous Inner Classes are horrific, and spoil Swing.
4) ASSERT. We need asserts!!!! Lucky J++ has a simple preprocessor. So many bugs could be caught if people used ASSERT more, Sun don't even think we need them!
Anyway, until at all of these relatively small additions are made, C++ is going to rule supreme.
At least for me
Fully clusterable, fault tolerant Application Server / Web server. Written in Java.
We designed our entire backend around it, thousands of users and it is extremely stable and has allowed us very fast development.
I program in C++, C and Java. Most of my work is C++. I have found Java is a better language to program in, it forces you to have better programming style.
Code that took me 4 weeks when using C++ takes me 2 weeks in Java and it is likely to have less bugs due to memory allocation problems etc..
We have also found that anyone that is pretty new to programming can pick up Java and become a useful programmer in 1/5 of the time it would take if they were using C++ or C.
My mistake for not being clearer, I meant applets when I used web apps in reference to HTML and script kiddies. Java Server Pages and servlets are very good technologies but most people think applets with regards to Java on the web.
You're probably an MSCE aren't you?
Java is an amazingly easy language and has great in support with the online API and the online tutorial that explain every aspect of the language. Last fall, I had no prior knowledge of Java and was an intermediate C++ programmer. With the above links as my primary guides I am now an excellent Java developer.
In fact, at the start of my spring break I wanted to create an online survey with the data stored in an Oracle database. With no prior knowledge of JDBC or servlets I created my survey within 3 days (most of which was spent configuring, java web servlet engines & battling the fact that Oracle doesn't support jdk 1.2).
My point is this, languages change and mature all the time. C today is not C of 20 years ago. C++ has changed enough in the last decade that a large number of developers in industry are mystified by several aspects of the language (STL? exception handling? namespaces?). Java is a mere 5 years old and to believe the language will not evolve further before stabilizing is wishful thinking. But at least in Java's case clicking a few webpages on Sun's webpage bring you up to speed rapidly.
PS: The MSCE crack is not a flame but a genuine question. I have noticed that MSCE's unlike computer science majors believe that once one learns something that's all they have to know. I guess it comes from getting certification after taking a few exams while CS majors usually use several languages in school and also since they spend 4 years in school usually see how languages change/mature before they get into the real world.
PPS: You actually have Swing as an item in your resume? Interesting.
OK I'm late for class so I'll make this quick. The point of my post was that the original poster was bitching about Swing being a come-and-go fix that would make him look like a relic on his resume. The part about swing being come and go is simply not true. Secondly who puts aspects of a language on their resume? Not I know Java, but I know the AWT or Swing only?!? If you know Java anbd you know how to program using swing is simply using another bunch of classes or another library...it's not like people go around saying I know how to use the string.h libraries in C and put that on their resume
Yes, well you could do the same thing in VB in probably half the time, and it would run 10 times faster.
Next time click the links before answering...
Java web pages serve faster than anything script based except mod_perl because they are memory resident via the Virtual Machine while CGi has to be read from disk. So the 10 times faster crack is simply bullshit. Secondly why did you assume I meant I was using Windows?
Aight, gotta go to class, later.
One of the classes I took last semester had such an application but it was rather simple (not very complex UML diagrams). I planned to hack at it but never found a good book on UML so I never did. Here's a link to the application for Windows, Macs, and *nix.
-ryan
"Any way you look at it, all the information that a person accumulates in a lifetime is just a drop in the bucket."
I tried Swing once, but discovered it was both slow and not yet widely deployed in browsers. But that was six months ago. Have things improved?
can anyone point me to a real-world application or website that actually uses Java? I mean properly, not just a tiny applet showing the time or something.
Off the top of my head, let me see Mail.com uses Java to serve its pages. Does Oracle's new Enterprise database count?
And from Sun's page of industry news, we have companies like RSA, Oracle, Netcom, SAAB, Delta Air etc. using Java in mission critical situations on a daily basis.
Posts like this make me wonder about who composes slashdot's readership. Because only script kiddies and so-called web developers (HTML and javascript kiddies) use Java as a web app language. Also no one in his right mind uses Java for GUI development if the application has any degree of complexity. But as a middleware development language it is practically untouchable. When it comes to speed of development, maintainability and expandability for business applications few things beat Java. Add a native GUI or web interface depending on your application and a rock solid app has been created.
PS: Myth dispel mode Oh yeah, by the way Java pages are faster or at the very least as fast as CGI, it has to do with being memory resident a la the VM as opposed to being read from disk. Here's a benchmark and a link or two.
Available in HTML and (gasp!) Word format...