Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Traps in Java
Chan J., Yang W., Huang J. Journal of Systems and Software72 (1):33-47,2004.Type:Article
Date Reviewed: Aug 17 2004

The portability of Java applications is directly dependent on the consistency of their Java Virtual Machine (JVM) implementation. The Java language places a lot of emphasis on simplicity. The design tradeoffs in language design--to ensure a feature-packed, easy-to-use language--have resulted in ambiguities for developers. This paper provides an insightful look into the various ambiguities and irregularities in Java.

The first section of the paper discusses the default access ambiguities resulting from the mixing of inheritance and package relationship rules. The problem is described with three illustrative examples, which address, respectively, static and instance methods, member variables, and abstract classes. The next set of ambiguities deals with widening primitive and reference conversion. The primitive and reference conversions are implicitly done in Java. The example demonstrates the problem in scenarios where overloading and inheritance, being employed in the logic, conflict with the rules of widening conversions. The next section of the paper discusses irregularities in the language, which range from import declarations to access privileges. The irregularities presented in this section can be statically checked at compile time, for example, the differences in method and field overloading rules. The last section addresses the inconsistencies that arise because some parts of the Java language specification are open to interpretation by the compiler writers.

The paper provides a fairly comprehensive evaluation of the various ambiguities and irregularities of the Java language. The authors used data from Java Development Kit (JDK) 1.0.2 to 1.3.0, primarily to demonstrate the ambiguities in the Java language. It is an accepted fact that JVM implementations have become better and more consistent with each significant release. Java 2 Platform, Standard Edition (J2SE) 5.0 (the upcoming release in Fall 2004) has introduced support for generics that can address some of the widening conversion issues. The information in this paper can be extremely helpful in creating processes like coding conventions, and programming best practices that can avoid these traps. Developers and architects will find this material useful, not only in understanding the Java language better, but also in making sense of previously encountered bizarre application behavior.

The paper is well written, and backed by good and concise sample code and data. I would definitely recommend this paper to all developers using Java.

Reviewer:  Satadip Dutta Review #: CR130018 (0501-0052)
Bookmark and Share
 
Data Types And Structures (D.3.3 ... )
 
 
Java (D.3.2 ... )
 
 
Object-Oriented Programming (D.1.5 )
 
Would you recommend this review?
yes
no
Other reviews under "Data Types And Structures": Date
Advances in database programming languages
Bancilhon F. (ed), Buneman P., ACM Press, New York, NY, 1990. Type: Book (9780201502572)
Aug 1 1991
Pascal and beyond
Fisher S., Reges S., John Wiley & Sons, Inc., New York, NY, 1992. Type: Book (9780471502616)
Sep 1 1992
On the exact complexity of string matching
Galil Z., Giancarlo R. SIAM Journal on Computing 21(3): 407-437, 1992. Type: Article
Mar 1 1993
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy