Duplicate Code, Comparing and Sorting, and Complex Menusby chromatic
ONJava Newsletter for 03/13/2003
Welcome to another edition of the Java newsletter. This week we have two interesting articles that will help you reduce the amount of code you write. (As they say, you know you're on the right track when you can remove code and add functionality.)
Even outside of high school composition class, comparing and contrasting are necessary skills. That holds true even in programming. Objects make this a little tricky: which attributes do you want to compare and what do those comparisons mean? Budi Kurniawan's latest article, Making Java
Objects Comparable, explores the
java.util.Comparator interfaces, which, used properly, can save you much time and trouble.
To subscribe to the ONJava.com newsletter (or any O'Reilly Network newsletters), visit https://epoch.oreilly.com/account/default.orm and select the newsletters you wish to receive in your user profile (you'll need to log in with your existing O'Reilly Network account -- if you don't yet have an account, you'll need to create one).
To change your newsletter subscription options, please visit https://epoch.oreilly.com/account/default.orm and click the"Manage My Newsletters" link. For assistance, send help to
Tom Copeland's previous article, Static Analysis with PMD, introduced the open source Java source analyzer. Tom returns this week to explain how PMD can detect duplicate code. Think you're immune? The JDK 1.4 source code has dozens of instances of duplicate code--over a hundred lines in several spots. Read more in Detecting Duplicate Code with PMD's CPD.
We're continuing our way through "Java Swing, 2nd Edition," in our book excerpt series. This week, learn all about complex menu items, like radio buttons and checkboxes. Read more in Java Swing: Menus and Toolbars, Part 6.
Next week, we'll take a look at a slightly different model for distributed programming. Ever heard of Linda? If not, you're in for a treat.
O'Reilly Network Technical Editor
ONJava.com News and Weblogs
Other O'Reilly Network sites
Return to list of ONJava Newsletters.
Return to the ONJava.com.