Search |
||
Read My MindPosted by editor on September 11, 2008 at 4:25 AM PDT
New annotations to make your code more toolable One funny thing about annotations is that after they were added to Java SE 5, they were just sort of left there to be used as third parties saw fit, without a lot of significant use within Java itself. You could mark that a method was an Other tools adopted annotations quickly, notably Hibernate and JUnit, but Java itself continued to not really do much with them, even in Java 6. However, in Java 7, things are gonna change. This is the topic of today's Feature Article, The Open Road: javax.annotation. This latest installment of Elliotte Rusty Harold's ongoing column about upcoming Java 7 features, takes a comprehensive look at all the standard annotations that may be coming in Java 7, and how they'll help your development process:
In Java Today, the java.net Education Community has re-launched at https://edu-gelc.dev.java.net/. The site is aimed at "students, educators, developers, parents, and anyone else interested in tools or curriculum for teaching Information and Communication Technology," with separate starting points for students, educators, and developers. The latest edition, issue 180, of the JavaTools Community Newsletter is out, with tool-related news from around the web, including new releases from JT Harness and AppTale, new tool projects in the community, and a Tool Tip on using JavaNCSS to measure code complexity. Robert J. Miller compares Java to Ruby on Rails from the point of view of technology entrepreneurs and, tallying up their respective features, declares it a dead heat. "In a nutshell, Java is not good for entrepreneurs because it is too complex and too slow to develop, configure, and deploy your web application. Ruby on Rails will get you off to fast start because it excels at time to market and low costs but leaves you hanging when it comes to scalability. Here is my entrepreneurial web technologies report card." By coincidence, Java and RoR get the exact same score, 3.07, when Robert tallies up the grades. Terrence Barr passes along evidence that phoneME performance rocks! in today's Weblogs. "The folks over at BugLabs have been one of the earliest and most serious adopters of phoneME - they are using phoneME as the basis for their core product. Lately, they have done a series of performance tests to compare phoneME with other open source VMs such as Cacao and jamVM. They just published their second round of results after some tuning and turning on the phoneME JIT compiler." In GlassFish V3 Prelude Update Tool, Ludovic Champenois notes a nice surprise when he rebooted his computer. "Yesterday, I was happily surprised by the ease of use of the GlassFish Update Center... For some reasons (installing iTunes 8.0 and QuickTime), I had to reboot my MacBookPro, and on reboot, I noticed a nice "Update Tool Notifier" on my desktop." Fabrizio Giudici is disappointed that one of the best Java conferences has been forced to change its name again, as he explains in JavaPolis -> Javoxx -> Devoxx. "This morning I've been really surprised when I read the newsletter from Javoxx (former JavaPolis) and learnt that the belgian guys had to change again their name, because even Javoxx was a trademark problem for Sun lawyers. Boys, this is unbelievable." Come to think of it, Fabrizio, isn't that the same reason that Slashdot rips on Java so much?
In today's Forums,
Continuing a discussion we featured yesterday, Current and upcoming Java Events :
Registered users can submit event listings for the java.net Events Page using our events submission form. All submissions go through an editorial review before being posted to the site. Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of java.net it will be archived along with other past issues in the java.net Archive. New annotations to make your code more toolable »
Comments
Comments are listed in date ascending order (oldest first)
Submitted by mrmorris on Thu, 2008-09-11 12:41.
Some would say annotations makes your code more terrible, not toolable. You left out SuppressWarnings which very well demonstrates the problem with annotations, how they can never replace proper language constructs like marker interfaces and modifiers to name a few.
Submitted by jwenting on Thu, 2008-09-11 13:14.
Annotations for the sake of making the job of a code analyser easier are bad. Tooling should serve the programmer, not the other way around.
SuppressWarnings can have a place, specifically to make it known to a compiler (or other tool) that you are aware of a potentially risky construct and don't want to be reminded of that, but that's about as far as should go (and it does also make your job easier by acting as a filter for compiler output).
Of course annotations in general often make code look bad and hard to read. The mechanism is also extremely limited as it doesn't support OO principles like inheritance. An annotation to one class isn't inherited by its children, making for a lot of extra typing to have those children have the same annotations as their parent.
Submitted by fabriziogiudici on Thu, 2008-09-11 13:56.
"Come to think of it, Fabrizio, isn't that the same reason that Slashdot rips on Java so much? "
Well, not really. :-) A reasonable reaction is to complain, and then keep using the Java technology if you used to think it is great. Or stop using it if you change your mind, but for some other good reason. Slashdot's just acted as a histeric "prima donna".
For what concerns annotations, I think they are great. You're not serving the code analyser, you're just better documenting your code (in a formal way), and as a consequence the tool analyser works better. Of course you can misuse them, as for any other software tool. I don't think there will be ever the Automatic Perfect Code Generator, being the man with the keyboard the ultimate responsible or quality, but now he can work better.
|
||
|
|