SunQuest
 
       Java
  Home arrow Java arrow Page 6 - Java Comes of Age
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM developerWorks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Java Comes of Age
By: Simon White
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 20
    2004-04-07

    Table of Contents:
  • Java Comes of Age
  • Type-Safe Enumerations
  • Static Import and Generics
  • Enhanced For Loop
  • Auto-boxing, Auto-Unboxing, and VarArgs
  • Meta-data

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Java Comes of Age - Meta-data


    (Page 6 of 6 )

    The idea of the new Meta-Data facility is to add annotations to your code that do not alter its semantics, but provide additional information that can be used by a compiler or other utilities. An example of such an annotation that you probably use already is the @deprecated tag. Marking a method as deprecated does not change the operation of the method, but does generate a warning when the compiler encounters it.

    Java 1.5 introduces a new tag, called @override, with which the programmer can explicitly state the intention to override a method of the superclass. If the superclass contains no such method, then the compiler generates an error:


    public @Overrides String toSring() {
            
    return value+" of "+suit;
        
    }

    In this example, I missed out the t of String in the method name, so that the method in fact does not in fact override the toString() method of java.lang.Object. When the code is compiled it produces the following error:


    Card.java:22method does not override a method from its superclass
         
    public @Overrides String toSring() {
                 
    ^
    1 error

    Defining your own tags to contain meta-data is somewhat more involved, and is therefore an activity that most Java programmers will eschew. On the other hand, I can imagine that once tags are defined, they would be used by large numbers of programmers. Depending on how the meta-data facility is configured, annotations can be available in the source-code, at compile-time, or even in the class files, accessible through Java reflection. This promises rich and powerful sets of annotations that can be used at different stages of the development lifecycle for many different purposes.

    Conclusions

    There are some other new features, too. The features that I found most interesting are the following:

    • Extensions to JDBC RowSets to provide caching and filtering.

    • Two new look-and-feels: Synth, a skinnable look and feel, and Ocean, a new theme for Metal.

    • There is now printing support for the Swing JTable.

    • Improved diagnostic abilities: using Thread.getStackTrace(), it is now possible to programmatically generate a stack trace as an array of StackTraceElements.

    Java1.5 is an impressive step forward, although not all of the changes are popular among developers. I have read several discussions in which some people express the sentiment "Why do I need that -- I can get on perfectly well without it!". That may be true. But most of the language changes in Java 1.5 aim to reduce programming errors and increase productivity. Developers who do not embrace such changes risk being left behind by more receptive, and ultimately more productive, peers.

    Although I welcome the changes from a technical standpoint, one cannot help but wonder what would have been included in Java 1.5 were it not for the driving influence of .NET and C# in the marketplace. I believe that new features such as enumerations and generics are a direct response to the features of C#. The intense competition for market share between Sun and Microsoft is not only an interesting sideline sport, it is also accelerating the technological advances from which we, as developers, will benefit.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

       

    JAVA ARTICLES

    - Adding Images With iTextSharp
    - Adding Columns With iTextSharp
    - Creating Simple PDF Files With iTextSharp
    - The Spring Framework: Understanding IoC
    - Introducing the Spring Framework
    - Java Classes
    - Completing the Syntactic Comparison of Java ...
    - Syntactic Comparison of Java and C/C++
    - Java Statements
    - Conditionals, Expressions and Other Java Ope...
    - Java Operators
    - Primitive Data Types and Basic Language Rule...
    - Java and Object-Oriented Programming
    - Java Beginning Programming
    - Gaming Development Setup

    BlackBerry VTS




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway