www.jcp.org/en/jsr/detail?id=270). This column is... " />
 

What’s Not Coming in Mustang



Email    print   
April 15, 2005 —  (Page 1 of 2)
Java’s next “Mustang” (Java 6) release has finally entered the JSR process (JSR 270: www.jcp.org/en/jsr/detail?id=270). This column is the first of several that will look at the proposed changes.

Rather than providing an integrated approach to the new release, Mustang is just a collection of 11 existing JSRs, each with its own expert group. These groups are essentially autonomous. The reality is that there’s no overall architecture, and more to the point, there’s no architect coordinating the Mustang work.

This lack of guidance is a significant problem. Here’s an example.

I talked recently about my concerns with Sun’s documentation for the annotation-processing tool (apt) that ships with Java 5. The apt APIs aren’t even part of Java; they’re in a com.sun package. JSR 269 (part of Mustang) defines a Pluggable Annotation Processing API, and will presumably fix this last problem. JSR 269 will probably break your existing code, though; it “is targeting the same general functionality as the apt tool...[but] it is expected the API included in this JSR will resemble but not necessarily be compatible with the existing apt API.”

It gets worse: “Users of apt have identified several limitations to the API; this feedback should be considered by the expert group.” Note the phrase “should be considered,” not “will be incorporated into the standard.”

Even if JSR 269 miraculously does improve the quality of the API, it doesn’t solve the real problem: apt is a kludge. To effectively perform compile-time annotation-processing, you need hooks into the compiler itself, not a preprocessor that mimics a compiler by giving you partial access to a limited set of syntactic elements. As it stands, apt can’t be used to actually modify the behavior of the compiler.

Consider an @property attribute, used to simplify a class that will be used in a program that requires the existing JavaBeans-style getter/setter idiom. The compiler should automatically generate get/set functions for you when it sees an @property applied to some field. The best you can do with apt, however, is create a brand-new java-source-code file for a class that wraps the one you’re actually processing, and then compile that file externally. The wrapper class must have a different class name than the class you wrote, and it won’t integrate cleanly with your program. As it stands, apt just doesn’t do the job.




Pages 1 2 


Share this link: http://sdt.bz/28542
 
Most Read Latest News Blog Resources

Add comment


Name*
Email*  
Country     


  • Comment
Loading




close
NEXT ARTICLE
Not a Cease-Fire, Not a Truce
Sun wants to expand the penetration of Java within the enterprise, and more tightly couple the well-known Java brand around Read More...
 
 
 
 
News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 

Download Current Issue
FEBRUARY 2012 PDF ISSUE

Need Back Issues?
DOWNLOAD HERE

Want to subscribe?


 
blogs tab
Are you at risk for burnout?
Burnout is a severe problem and it can strike at any time. Here's how to tell if you are nearing the edge.
02/09/2012 02:16 PM EST

Agility, mom, and apple pie
If we're to evaluate the state-of-the-art in software development, we should start with the values espoused in the Agile Manifesto.
02/07/2012 11:57 AM EST

RIM woos developers with free tablet
How do you get more apps ported to the BlackBerry PlayBook? By giving every developer a free tablet, of course!
02/04/2012 01:57 PM EST

GitHire: Use Headhunters to Find Your Perfect Programmer
Are you a hiring manager tired of scouring the job boards? Check out this new service that will find 5 people interested in your jobs.
02/03/2012 12:17 PM EST

Facebook claims hacker cred
Facebook's SEC S-1 filing form includes a short essay on the Hacker Way by Mark Zuckerberg himself.
02/02/2012 08:26 AM EST

Ryan Dahl steps down
Ryan Dahl, creator of Node.js, steps back from his position as gatekeeper for the project.
02/01/2012 04:58 PM EST

 
Events calendar tab
2/13/2012 to 2/16/2012
Santa Clara
TechWeb

2/26/2012 to 2/29/2012
San Francisco
BZ Media

2/27/2012 to 3/2/2012
San Francisco
RSA

3/4/2012 to 3/7/2012
Las Vegas
IBM Tivoli

3/5/2012 to 3/9/2012
San Francisco
TechWeb