星期一, 一月 10, 2005

Calvin Austin: Five Reasons to Move to the J2SE 5 Platform

By Calvin Austin, January 4, 2005

This article provides five important reasons to move to the Java 2 Platform, Standard Edition (J2SE platform) 5.0. Each reason is supported by data and references to prove that the 5.0 release will reduce development and runtime costs.
J2SE 5.0 (codenamed Project Tiger) was released at the end of September 2004. It is one of the most significant updates to the Java platform in many years. The Java community has eagerly welcomed its new features, yet these new features are not what makes the release special. What does? The platform was subjected to a higher level of testing than any previous version, to prepare it for mission-critical production.
Given the wealth of improvements in J2SE 5.0, choosing the top five reasons for this article was a tough task. My choices follow.
#1: Your application already works on 5.0

"To ensure this high level of backward compatibility, the number of compatibility tests was doubled..."
Calvin AustinSun Microsystems

You don't need to redesign or recompile your application to take advantage of J2SE 5.0. Not only is your investment in existing applications protected but you actually benefit from running your application on a newer Java runtime.
To ensure this high level of backward compatibility, the number of compatibility tests was doubled from 1.4. These compatibility tests are part of a Java test suite that contains nearly 200,000 tests and includes testing many well-known Java applications.
So your application runs unmodified. What does J2SE 5.0 offer then?
Improved Performance
The performance of both client and server applications have been significantly improved in J2SE 5.0. As the improvement in performance has been so impressive, I've made it Reason #2. More on this in the following section of this article.
Monitoring and Manageability
J2SE 5.0 brings an advanced monitoring and manageability framework built into the Virtual Machine for the Java platform (Java Virtual Machine or JVM). [Note: The terms Java Virtual Machine and JVM mean a Virtual Machine for the Java platform.] You can use your existing management consoles with industry-standard JMX and SNMP protocols to monitor a JVM and even detect low memory conditions. The JDK release provides a demo, called JConsole. It lets you evaluate the benefits in monitoring the JVM and see how you can exceed your availability metrics.
New Look and Feel
The Java platform already contains a pluggable Look-and-Feel framework. The addition of the new Ocean Look-and-Feel enables cross-platform applications to switch between Ocean or the native operating system's look-and-feel, without the need to rebuild or recompile them.
#2: It is faster

A number of factors play into J2SE 5.0's improved speed, illustrated in the following figure.

Reduced startup time
If you haven't started a desktop Java application in the last few years, you may be in for a pleasant surprise. The introduction of class data sharing (in combination with other streamlining options) has shaved nearly 30 percent off the startup time for some applications.
Great 64–bit performance
The J2SE 5.0 64-bit JVM delivered record results with the AMD64/Opteron CPU and Suse Linux Enterprise Edition 8.0 SLES 8.0. In addition, the 32-bit version of the JRE can run side by side under the same 64-bit OS for use with existing 32-bit web browsers.
Performance ergonomics
The JVM is now self-configuring and self-tuning on server-class machines. A server-class machine is a machine with two or more CPUs and at least 2 GB of memory. The server-based performance ergonomics kicks in by rightsizing both the memory required and the class of optimizations needed for longer lived applications. This has resulted in an 80 percent improvement on one application server benchmark without changing a line of code or supplying any runtime options!
#3: Reduced development time

Integrated development environments (IDEs) have tried to make developers' lives a little easier with auto-completion and wizards for common tasks. J2SE 5.0's new language features further streamline development, whether you use an IDE or handcode in a text editor.
Reduced need for developer coding
Many of the Java language changes reduce the amount of code a developer has to write. The following figure quantifies that reduction, in comparison to J2SE 1.4.2. To take a real life example, one open source application server uses over over 2,000 Iterators. By substituting the new enhanced for loop, the code would be reduced by up to 40,000 characters. To a developer, that is a saving of at least two hours of solid coding (5 characters a second).

Figure 2: Reduced Coding Effort (Fewer Lines of Code).
The addition of metadata into the platform provides the greatest scope for reduced development time through the use of tools that can generate boilerplate code and configuration information. In the case of SOA and web services, as defined in JSR 181, developers should expect to see over a 50 percent reduction in code by auto-generating common code. [Note: The preceding figure shows a metadata JAX-RPC example from 209 to 95 characters, Enhanced for loop using generics 139 to 100 characters, non-generic enhanced for loop for each 121 to 90, to/from autoboxing 69 to 56 characters.
Metadata will reduce the amount of effort required for deployment descriptors. One proposal for EJB 3.0 removes the need for any deployment descriptors by default by generating the configuration information from the application itself.
Improved Error Checking Savings
A google search using the terms "ClassCastException" and "help" generated nearly 40,000 hits. A more focused search on the Sun forums reported 3,444 cases of developers asking for help to track down unexplained runtime failures due to class cast exception issues.
Out of those 3,444 cases, over 470 involved the pre-generics vector class. In terms of return on investment, any runtime error can cost on order of 10 percent of a company's website revenue at peak periods (300m GBP on revenue of 3Billion GBP). That doesn't even begin to factor in the additional cost to personnel and goodwill.
The introduction of compile-time typesafe generic types to the Java platform reduces the risk of runtime errors by alerting developers at development time if there is a type-matching problem. In the case of the 470 forum postings, the Vector and other key libraries in the JDK have been updated to use generics in J2SE 5.0 and will prevent a repeat of those unexplained runtime issues.
#4: Ready for Mission-Critical Systems
The 5.0 release offers enhanced scalability, quality, and deployment support.
Scalability
The Java platform was designed with scalability for both client and server machines. The 5.0 release introduces a powerful concurrency library that makes multi-threaded programming even easier and more powerful than before. The Java platform also provides support for both 64-bit and also multi-core and hyper-threaded chip technologies. The 64-bit JVM allows applications to use more than 4 GB of heap space and to integrate with other 64-bit applications. (reference 8)
Quality
The J2SE 5.0 platforms has completed a comprehensive set of burn-in tests on a large set of systems and OS variants. The tests involved many popular application servers and client applications. The last metric taken—the Mean Time To Failure stress test—ran to completion without any failures.
Deployment
Prior to J2SE 5.0, it wasn't easy to determine the utilization or transaction throughput of a production JVM. The new profiling tools and self-tuning features provide better production right-sizing information and configuration. These features reduce the scope for surprises when the application goes live.
To complete the deployment picture, as highlighted previously in reason number 1, the JVM can now be fully monitored remotely using industry-standard tools. This enables system administrators to successfully manage JVMs either in a cluster or in a traditional vertical scaling environment. Both the health and utilization of your deployed applications can be monitored.
To cap off the four technical reasons for upgrading, there is one final, important reason to move to 5.0.
#5: You Are in Good Company
Books based on J2SE 5.0 - Java 5.0 Tiger: A Developer's Notebook. David Flanagan, Brett McLaughlin. O'Reilly & Associates, 2004.- Java 2 v5.0 (Tiger) New Features. Herbert Schildt. McGraw-Hill Osborne Media, 2004.- Beginning Java 2, JDK 5 Edition. Ivor Horton. Wiley, 2004.- Core Java 2, Volume I, II (7th Ed.). Cay Horstmann, Gary Cornell. Pearson Prentice Hall, 2005.- Just Java 2 (6th Ed.). Peter van der Linden. Prentice Hall, 2004.- An Introduction to Programming and Object-Oriented Design Using Java 2, 2nd Ed. Jaime Niño, Frederick A. Hosch. Wiley 2005- The Java Class Libraries Poster : Java 2 Platform Standard Edition 5.0 (8th Ed.). Patrick Chan, Rosanna Lee. Addison-Wesley Professional, 2005.- Objects, Abstraction, Data Structures and Design Using Java Version 5.0. Elliot Koffman, Paul Wolfgang. Wiley, 2004.
The Java Community stands behind the improvements in J2SE 5.0. The J2SE 5.0 expert group comprised the following who's who of the Java industry: Apache, Apple, BEA Systems, Borland, Cisco Systems, Fujitsu, Hewlett-Packard, IBM, Macromedia, Nokia, Oracle, SAP, SAS Institute, SavaJe Technologies, Sun Microsystems, John Zukowski, Osvaldo Doederlein, and Juergen Kreileder.
There were 16 working groups, composed of well-known experts in the Java field. They formed a worldwide group of 160 experts collaborating on the J2SE 5.0 Java Specifications. The specifications covered everything from language updates to concurrency libraries to a class file-compression API. For more technical details, see J2SE 5.0 in a Nutshell. And the growing number of books in the sidebar on this page.
In addition to the Java expert input, the community at large has taken notice. There have been over one million downloads to date!
Summary
This article listed my top five reasons for moving to the Java 2 Platform, Standard Edition (J2SE platform) 5.0. (The article does not cover the full range of client- or server-side features.) Everything about the platform—from the specifications to the source code, which is licensed under the SCSL and Java Research Library—is available so that you can make your own decision. Contact us through our community forums to let us know what you like about the release.

星期三, 一月 05, 2005

I Will Not Smoke, laddie~

如果我有意去学着吸烟,那我肯定已经是个烟枪了…最近的事情一件接着一件,其实都没什么大不了的,都是考试,可不知道为什么自己总是那么不顺利的……呃,我没有怪任何人的意思,都是自己自找的,所有的这一切……

复变挂了,挂得很无谓,复习的结果和没复习一样。我真他妈不是学数学的料,怎么就能得那么低的分,怎么就那么不开窍。
我 告诉老婆没挂,实在不想她再失望了。她和我一起,忙前忙后的,寄希望于我能顺利地和她一起毕业,我们可以一起工作一起为我们未来的家努力,现在看来,这个 希望真要渺茫下去了……当时以为可以 和期末考试的一起考,昨天才知道,期末考试和即将到来的多媒体考试又重了,哦,那谁……

昨天去考离散数学,哈哈,这个最厉害了,本以为没什么问题的,结果,一节课没听的后果来啦:讲课范围变了,而且变的面目全非,我还是按我们那时的课程范围复习的,后果可想而知,还有隔壁宿舍的一个哥们儿,也这么尴尬地挂了……
打了电话给那个老师,可没戏,我也知道人家有多难,只是老婆放不下,非要给我继续求情,结果碰了一鼻子灰,哭了……

老婆,我知道我很没有用,让你每天担惊受怕,然后还不知羞耻地欺骗你,让你觉得我一切都很好……

不说这些了,都过去了,欠老婆的东西一辈子都难补偿给她……

明天又要有一门考试,那门多媒体,我只看了一丁点儿,该加油了,呵呵,加油啊,你……

星期一, 一月 03, 2005

千里迢迢,其实近在咫尺

很久没更新blog了,其实更多的是一种无奈呵,看自己的blog都要加一个国外的代理才行,有的时候连更新blog都要找那个代理,嘿嘿,印度的代理,唉,这世道,真讽刺……

最近大家都在谈海啸,其实好像印尼人比海啸更有影响力吧,随便到一些BBS、论坛看看,两帮两派,再加些骑墙派,在为一些八杆子打不到的人吵嘴,有的人拿出来例子说什么印尼仇视华人是有历史原因的,没记错的话好像是和红色革命输出还有关系,唉,不知道是哪辈子的事情了。
学校BBS上的一个JJ,fruitamy被砍号了,还不是因为骂了几句那些维护印尼人的人,咻,好在我还算有自知之明,倘若是我去吵,也许也没准就就义了。有人说印尼屠杀华人是人家的国家内部矛盾,呃,先抛开这个,那么残忍地杀、抢、奸、烧,罩上一个国家内部矛盾的帽子似乎别人再说什么就都是吹毛求疵了么?不知道都是怎么想的,呵呵……

好在我在哪里都是小角色,倒也自得其乐,每天四处看风听雨,注视着一个人一个人在那里陶醉的表演,时间过得真快……

工作总算定下来了,呵呵,很久以前的事了。又一次留在了天津,公司名叫博和利,感觉很没创意的名字只是因为创业者们都是Berkeley海归来的。笔试时很顺利,而且很拽地用英语答了很多题,大多是SAX、DOM、JDBC这种家常便饭,如果再不拽拽英语的话都对不起自己,还有一道求某一范围内质数的算法题竟然是我笔试前一个小时刚整理出来的……谁想面试时十分不顺利。我想可能是人家没以为我区区一介本科生掌握Java能到什么程度,所以问了一些在我看来基础得无从开口的东西……真的,如果这样东西平常到司空见惯,我还是真描述不出来
这下好了,长这么大了,还没在家乡以外的地方住过超过一个月,哈哈,失败?还是幸运?我只是感觉天津最近发展变化得很快,天津人似乎也比我想像得更淳朴。走在天津的大街小巷扑面而来的只有一种感觉:亲切。也许我真不是一个可以闯荡天下的人——说出来也很好笑,我自己安慰自己说:没事的,只要能上网的地方就都可以闯荡天下……

确实,网络让我一发不可收拾地Geek下去了。每天早上起来,人还没醒机器就先打开了,然后,FirefoxThunderbirdGmailGoogle GroupsSlashdot……等到该看的都看完了,盹儿也算醒过来了,恩,也差不多要吃中午饭了……
我没感觉这有什么不好,相反,我固执地认为这才是一个从事计算机行业的人应该有的习惯。身边有很多聪明的人,学东西很快,虽然我起步比他们早,但是如果掉以轻心就会让人家很快追上,可我一样没把他们当做威胁,呵呵,因为在我眼里能算得上Geek的人很少,如果我够资格能被别人视为Geek的话Geek代表一种生活态度,代表和计算机融合,借网络延伸。同样的工作,在一个Geek眼里是种享受是向人展示自己的机会而在那些或聪明或驽钝的人看来,只是工作倘若只拿计算机作为赚钱的工具,只把程序员看为工人、项目经理看为工头,那我想你应该在工作以外的时段里把键盘鼠标抛开,因为显然你没有足够的灵性去驾驭它们。

有幸听到James Gosling说:“I'm better now. Back to being a geek.