Comments
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Cloud Expo on Google News

SYS-CON.TV
Cloud Expo & Virtualization 2009 East
PLATINUM SPONSORS:
IBM
Smarter Business Solutions Through Dynamic Infrastructure
IBM
Smarter Insights: How the CIO Becomes a Hero Again
Microsoft
Windows Azure
GOLD SPONSORS:
Appsense
Why VDI?
CA
Maximizing the Business Value of Virtualization in Enterprise and Cloud Computing Environments
ExactTarget
Messaging in the Cloud - Email, SMS and Voice
Freedom OSS
Stairway to the Cloud
Sun
Sun's Incubation Platform: Helping Startups Serve the Enterprise
POWER PANELS:
Cloud Computing & Enterprise IT: Cost & Operational Benefits
How and Why is a Flexible IT Infrastructure the Key To the Future?
Click For 2008 West
Event Webcasts
Java Developer's Journal: "@ See Javadoc"
@ see Javadoc

My dear wife has just started to learn to use Java in her work and asks me a lot of questions as she begins her journey in this wonderful language. To almost all her questions my answer is the same: "See Javadoc."

In addition to being a way of avoiding having to find or know the answer, it constantly surprises me what is available in the Javadoc and how useful a source of information it can be.

When I began to use Java in 1998 I received the pointer of the Java API Specification, or Javadoc, from a colleague. Despite the limitations of the JDK 1.1 Javadoc style when compared to Java 2, I immediately found that it was much more helpful than my other reference books. The books might help you get started on Java but, once you're serious, the Javadoc is something I know I can't live without.

The obvious benefit of using Javadoc is getting the most accurate and detailed description of Java APIs. Most likely the Javadoc is written by Java API implementers who know the behavior of the API inside-out. When the API changes, so does the Javadoc, whereas books, tutorials, and other sources lag behind. To know how a mehod works, asks the author who committed the doc and code together.

To ensure that different vendors' Java implementations uphold Java's fundamental tenant of "write once, run anywhere," Javadoc plays a part too. For any implementation to claim that it is compatible to a certain Java specification, it must pass the conformance test suite, sometimes called Technology Compatibility Kit (TCK). Each test in the TCK is strictly written according to the Javadoc, and nothing else, to make sure that the behavior of an implementation conforms. So if your application relies solely on behaviors described in Javadoc, you not only leverage the TCK effort but also have the maximum assurance that the application will work across different Java implementations. On the other hand, un-Javadoc'ed behaviors are likely implementation dependent and subject to change in future releases. If your application relies on any of these, the guarantee of "write once, run everywhere" may no longer hold.

Javadoc is a "living" document, as it is continuously being updated and maintained. At Sun, a lot of change requests of Javadoc are filed by development teams and customers during the development of a new release of a Java technology. These include requests for API semantic changes, behavior clarifications, or are as simple as grammar or spelling corrections. Regardless of how trivial it is, each change request to Javadoc is treated seriously. Some of them have to go through thorough reviews and approvals. Each new release of a Java technology is often accompanied by hundreds of Javadoc improvements, so by using Javadoc you leverage all these efforts.

Today's Javadoc is more complete than ever. The String.substring() story is just one example, but if you have other questions, such as "What is the behavior of this method if the parameter is null?" or "Does this method throw IllegalArgumentException or IndexOutOfBoundException if the index is invalid?", take a look at the Javadoc and seek the answers there.

Javadoc is by no means perfect. You may find that an API's description lacks certain aspects or is not clear enough. Should you feel that way, the developer who implements this API may have felt the same and chosen his own interpretation in the API's implementation. The result is different behaviors across different implementations. It is important therefore that, as an API consumer, you file Javadoc change requests at http://bugs.sun.com/services/bugreport/index.jsp. Remember, a more precise and definitive Javadoc will result in more conformant Java implementations, which in turn increase the chance that your applications can run across different platforms.

So what can you do with Javadoc? See it, rely on it, and improve it.

About Xiaozhong Wang
Xiaozhong Wang is a software engineer at Sun where he has solved some security problems in his TCK (Technology Compatibility Kit) work.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

The article has a typo on the name 'mehod' (in the last sentence of the 3rd paragraph), it should be 'method'.

Java Developer's Journal: "@ See Javadoc" My dear wife has just started to learn to use Java in her work and asks me a lot of questions as she begins her journey in this wonderful language. To almost all her questions my answer is the same: 'See Javadoc.'


Your Feedback
Wyatt Wong wrote: The article has a typo on the name 'mehod' (in the last sentence of the 3rd paragraph), it should be 'method'.
Java Developer's Journal News Desk wrote: Java Developer's Journal: "@ See Javadoc" My dear wife has just started to learn to use Java in her work and asks me a lot of questions as she begins her journey in this wonderful language. To almost all her questions my answer is the same: 'See Javadoc.'
Latest Cloud Developer Stories
Can you bring services from the cloud to your customers faster and have them adopt it with ease of use or bring the power of bundled services to the fingertips of your clients without creating new rigid ‘apps stove pipes'? Do you want to prevent your business running away to publ...
OCZ Technology Group, a provider of high-performance solid-state drives (SSDs) for computing devices and systems, on Tuesday announced the Z-Drive R4 CloudServ PCI Express (PCIe) flash storage solution, designed to accelerate cloud computing applications and reduce operating expe...
Many organizations have embraced, or are considering, the benefits of cloud computing – speed, flexibility, increased expertise, shared workload, reduced costs, etc. The benefits are many – but so are the risks. What are the threats to cloud security? Which parties assume respons...
In August 2011, SHI Enterprise Solutions (ESS) division launched the SHI Cloud, offering reliable and cost-effective industrial-grade cloud computing platforms. That same division achieved an 82 percent increase in revenue over 2010.
SoftLayer Technologies on Tuesday announced the immediate worldwide availability of SoftLayer Object Storage, a redundant and highly scalable cloud storage service that allows users to easily store, search and retrieve data across the Internet, with optional CDN connectivity, or ...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers
ADS BY GOOGLE

Breaking Cloud Computing News
Salary increases will remain negligible in Japan this year, with employers instead turning to benefi...