 |
 |
 |
 |
 |
 |
Classworking toolkit: Generics with ASM
Java 5 generics provide information that's useful for many
classworking applications. Although Java reflection can be used to get generics
information for loaded classes, the requirement that classes be loaded into the
JVM can be a major drawback. In this article, classworking guru Dennis Sosnoski
shows how the ASM Java bytecode manipulation framework offers flexible access to
generics information without going through the Java classloading process. Along
the way, he looks deeper into the representation of generics in the binary
class format.
|
 |
Articles |
 |
07 Feb 2006 |
|
| |
Classworking toolkit: Analyzing generics data structures
|
 |
Articles |
 |
28 Mar 2006 |
|
| |
Classworking toolkit: Reflecting generics
Java 5 extended the Java language type system to support parameterized
types for classes, methods, and values. Parameterized types provide important
compile-time advantages by enforcing proper type usage and eliminating casts
from source code. Beyond these compile-time benefits, the type information can
also be useful for classworking tools manipulating Java code. In this article,
JiBX lead developer Dennis Sosnoski looks at how to use reflection to dig
beneath the surface of parameterized types and reveal the full glory of Java 5
application data structures.
|
 |
Articles |
 |
08 Nov 2005 |
|
| |
Classworking toolkit: Inside JiBX code generation
The JiBX framework builds on classworking techniques for fast and flexible conversions between Java objects and XML. But generating correct and verifiable bytecode isn't always easy, and lead developer Dennis Sosnoski has gone through some painful classworking experiences along the way to the 1.0 production release. He shares his insights in this article, discussing the internal structures used for code generation and the steps he's gone through to make sure that the generated code follows JVM rules.
|
 |
Articles |
 |
06 Sep 2005 |
|
| |
Classworking toolkit: Use J2SE 5.0 features on older JVMs
Many of the J2SE 5.0 language features would be just as useful for older JVMs, but the compiler that implements these features generates code that requires JDK 5.0 or later. Fortunately, there's an open source project that bridges the gap between J2SE 5.0 and older JVMs -- Retroweaver. Retroweaver converts your class files to eliminate the JDK 5.0 dependency while adding its own library of support functions to make most 5.0 features fully usable in older JVMs. If you like J2SE 5.0 language features but can't make the jump to using JDK 5.0 at run time, Retroweaver may be just what you need.
|
 |
Articles |
 |
06 Jul 2005 |
|
| |
Classworking toolkit: Annotations with ASM
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.
|
 |
Articles |
 |
07 Jun 2005 |
|
| |
Classworking toolkit: Putting aspects to werk
Aspect-oriented programming (AOP) promises to keep code clean by separating out functionality that applies across the application, rather than to a particular class or package. Logging is one of the commonly used examples of this type of function. Can AOP help with logging? In this article, developer and AOP enthusiast Dennis Sosnoski looks at using the AspectWerkz framework to find out.
|
 |
Articles |
 |
08 Mar 2005 |
|
| |
Classworking toolkit: Combining source and bytecode generation
JiBX 1.0 uses classworking techniques to enhance the bytecode for compiled classes and directly generate new classes. Bytecode generation has some major advantages over working at the source code level, but it can sometimes get in the way of building and debugging your application. Even aside from issues of convenience, some developers just don't trust anything but "The Source." For JiBX 2.0, lead developer Dennis Sosnoski wants to support both source and bytecode generation techniques. In this article, he discusses some of the differences between source code and bytecode generation techniques and gives his take on how to reconcile the two.
|
 |
Articles |
 |
04 Oct 2005 |
|
| |
Classworking toolkit: Annotations vs. configuration files
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.
|
 |
Articles |
 |
02 Aug 2005 |
|
| |
Classworking toolkit: ASM classworking
In this edition of Classworking toolkit, consultant Dennis Sosnoski compares the ASM bytecode manipulation framework to the Byte Code Engineering Library (BCEL) and Javassist frameworks he previously discussed in his Java programming dynamics series. ASM claims to be small and fast -- but how does it match up with the other frameworks? Dennis uses an example from his earlier series to evaluate both usability and performance.
|
 |
Articles |
 |
12 May 2005 |
|
| |
Classworking toolkit: Performance tracing with aspects
In this edition of Classworking toolkit, consultant Dennis Sosnoski takes up where he left off last month by applying an aspect-oriented approach to performance analysis. He investigates a client application using the Apache Axis Web services framework to find where the execution time is being spent. Along the way, Dennis looks into the issue of measuring time intervals in Java code and shows how you can find the granularity and overhead of the timer implementation on your system.
|
 |
Articles |
 |
05 Apr 2005 |
|
| |
Classworking toolkit: Cover your code with Hansel and Gretel
Unit tests provide a great technique for making sure that code performs to specifications. But the quality of unit tests is up to the test writer, and the results from unit tests are only as good as the quality of the tests. How can you make sure your unit tests deliver the quality you need? In the first article of this new series dedicated to classworking tools, regular developerWorks contributor Dennis Sosnoski discusses how code coverage tools provide one important quality check for your tests.
|
 |
Articles |
 |
08 Feb 2005 |
|
| |