| View: | [ 2009 | 2008 | 2007 | 2006 | 2005 | 2004 | 2003 ] |
| Articles |
- Making the Most of Java's Metadata, Part 3: Advanced Processing by Jason Hunter - [Clicks: 222]
In the first article in this series of four, I introduced Java's new metadata facility and described the built-in annotation types @Override, @Deprecated, and @SuppressWarning. In the second article I showed how to write custom annotation types and use the meta-annotations from java.lang.annotation to control annotation behavior. In this third article, I'd like to demonstrate the techniques and mechanisms to process annotations and change program behavior at runtime and even compile-time.
http://www.oracle.com/technology/pub/articles/hunter_meta_3.html - Sep, 2005 - Using Annotations with Aspects in Pre-Java 5 Versions by Rod Coffin - [Clicks: 120]
If you're interested in combining the power of annotations and aspects but can't yet move to Java 5, don't be discouraged; you still have robust options. Several AOP frameworks provide this capability today.
http://www.devx.com/Java/Article/29114 - Aug, 2005 - Classworking toolkit: Annotations vs. configuration files by Dennis M. Sosnoski - [Clicks: 81]
Annotations let you specify metadata as part of your source code. With this feature, you can embed tool instructions in your code rather than creating separate configuration files that you then need to maintain in parallel to the source code. But, as Java consultant Dennis Sosnoski explains, configuration files still have their uses, especially for aspect-like functions that cut across the source code structure of an application.
http://www-128.ibm.com/developerworks/java/library/j-cwt08025.html - Aug, 2005 - Annotations to the rescue by Norbert Ehreke - [Clicks: 143]
Java annotations can be used for more than just marking deprecated code. In this article, they are used to hand over method-invocation control to a lightweight framework component that manages the sequence in which a set of methods is called. The responsibility and logic of correct initialization, setup, etc., can thereby be delegated away from the class to the client application for adjustable configuration and control.
[Includes source code]
http://www.javaworld.com/javaworld/jw-08-2005/jw-0801-annotations.html - Aug, 2005 - Making the Most of Java's Metadata, Part 2: Custom Annotations by Jason Hunter - [Clicks: 125]
In my previous article in this series, I introduced Java's new metadata facility and described the built-in annotation types @Override, @Deprecated, and @SuppressWarnings. In this article I'll show you how to write your own annotation types and make use of the built-in annotations from the java.lang.annotation package to control your annotation's behavior
http://www.oracle.com/technology/pub/articles/hunter_meta_2.html - Aug, 2005 - Create a Simple IoC Container Using Annotations by Eugene Kuleshov - [Clicks: 158]
The combination of dynamic proxy and annotations makes Java code smaller and allows you to build systems that are more dynamic and less coupled.
http://today.java.net/pub/a/today/2005/07/05/IOCAnnotation.html - Jul, 2005 - Classworking toolkit: Annotations with ASM by Dennis M. Sosnoski - [Clicks: 50]
Are you tired of building and maintaining toString() methods for all your data classes? In this edition of Classworking toolkit, consultant Dennis Sosnoski shows how you can automate the process using J2SE 5.0 annotations and the ASM bytecode manipulation framework. He takes advantage of the new J2SE 5.0 instrumentation API to invoke ASM as classes are loaded into the JVM, providing on-the-fly class modification at run time.
[Includes sample code]
http://www-128.ibm.com/developerworks/java/library/j-cwt06075/ - Jun, 2005 - An annotation-based persistence framework by Allen Holub - [Clicks: 96]
The getter/setter idiom has always been problematic; it allows too-broad access to the implementation of your classes, degrading maintainability as a consequence. The J2SE 5 annotation (or metadata) feature provides an alternative. Rather than using introspection to find get/set methods, you can "tag" an object with an annotation and then access that annotation at either compilation or at runtime. This article both describes the annotation mechanism and presents the output side of an XML-based persistence mechanism that uses annotations to tag persistent classes and fields.
[Includes source code]
http://www.javaworld.com/javaworld/jw-03-2005/jw-0321-toolbox.html - Mar, 2005 - Using Annotations to add Validity Constraints to JavaBeans Properties by Anders Holmgren - [Clicks: 64]
This article shows how you can use the new Annotations feature of J2SE 5.0 to add constraints like minimum and maximum length, regular expressions, and more to your JavaBean properties.
[Includes source code]
http://java.sun.com/developer/technicalArticles/J2SE/constraints/annotations.html - Mar, 2005 - Java Annotation Facility - A Primer by Krishnan Viswanath - [Clicks: 163]
The 5.0 release of JDK introduced a slew of new features. A powerful technique that resulted from the JSR-175 recommendation is the Program Annotation Facility. It can annotate code in a standard way and automate the generation of source code or configuration files, helping cut down on boilerplate code.
http://www.sys-con.com/story/?storyid=48539&DE=1 - Mar, 2005 - Learn to Use the New Annotation Feature of Java 5.0 by Javid Jamae - [Clicks: 109]
Developers have always struggled to find ways of adding semantic data to their Java code. They had to: Java didn't have a native metadata facility. But that's all changed with version 5.0 of Java, which allows annotations as a typed part of the language.
http://www.devx.com/Java/Article/27235 - Feb, 2005 - Making the Most of Java's Metadata by Jason Hunter - [Clicks: 105]
The recent release of J2SE 5.0 (also known by its codename "Tiger") introduced numerous Java language changes designed to make programming in Java more expressive, developer-friendly, and safe. I covered many of Java's new features in a September 2003 article entitled "Big Changes Coming for Java". One significant change I didn't cover-at the time it hadn't been fully sketched out-was Java's Metadata facility. In a new four-part series of articles, beginning with this one, I'll continue where I left off one year ago and show you how to make the most of Java's Metadata. In this first article I'll explain the purpose of metadata and demonstrate how to use metadata annotations provided in the core J2SE libraries.
http://www.oracle.com/technology/pub/articles/hunter_meta.html - Jan, 2005 - Validating Objects Through Metadata by Jacob Hookom - [Clicks: 103]
Many developers have been complaining about having to manage numerous XML configuration files alongside their Java code. With the recent addition of metadata to Java, common configuration details in frameworks can now be rolled right into your Java files through annotations. For a brief introduction to metadata and annotations, see Sun's article "J2SE 5.0 in a Nutshell." In this article, we will summarize how configuration data is managed today and what metadata will offer in the future, followed by an implementation of how annotations can be used in a simple validation framework.
[Includes sample code]
http://www.onjava.com/pub/a/onjava/2005/01/19/metadata_validation.html - Jan, 2005