Skip to main content

Tear It Up

Posted by editor on March 28, 2006 at 7:00 AM PST

Are "working" and "good" code the same thing?

Functional tests will tell you if your code behaves as expected, but is that enough? Is it possible that some class or classes, while passing all the tests set out for it, could be horribly written, ill-conceived, unscalable, poorly designed, unmaintainable, and generally an accident waiting to happen? Of course, that's possible.

So what are you going to do about it?

For one thing, you can look to see whether you're adhering to good principles in your code. Do you, for example, program to interfaces and not implementations? Can you prove it?

In today's
Feature Article,
Testing Java in an Object-Oriented Way, Soumen Chatterjee makes the case for testing just how OO your code is:

It's really very important to perform object-oriented testing, if your software is written with the intention of reusability from either system or framework points of view. It is very important to test open source and third-party software and, OO testing is the only way to test semantic contracts.

In the article, he shows how to employ JUnit to verify that your classes are adhering to a set of design patterns that describe good OO programming, and offers a set of twelve "golden rules" for maintaining a happy object-oriented system.

In Projects and

ZDNet blogger Paul Murphy is dicussing at a potential role for Jini in the small device space, vis-a-vis the the Microprocessor Architecture for Java Computing (MAJC). In Here Jini, Here Jini, Jini, jini, he writes that Jini "has also proven to have been both ahead of its time and the underlying proof of concept for quite a few successor technologies today."

Project GlassFish demonstrates its management abilities in the SDN article Managing and Monitoring Web Services in Project GlassFish, which "shows you with an example how to develop, deploy, and debug a Web service on Project GlassFish, without any knowledge of the underlying, often complicated, concepts."

Spurred by a blog by Michael Feathers, Bill Venners is kicking off a discussion about the idea of using The Committer Model for Commercial Development, which we feature in Also in
Java Today
. Bill writes: "This could be seen as a way to force code reviews by a few people who, because they are members of this special class of 'committer', might feel more responsible towards the quality of the code. The committers might also be more familiar with the code, and probably more talented in general at programming. It could also be a pragmatic way to accept the fact that you can't hire only superstar programmers."

"This is not your father's J2EE! If you were scared off of J2EE because it seemed too complex, it's time to take another look. If you've been attracted to alternative technologies such as Spring and Hibernate, you'll find many of the good ideas from those technologies in Java EE 5." That's the message -- making life simpler for developer -- made in the interview article The Advantages of the Java EE 5 Platform: A Conversation with Distinguished Engineer Bill Shannon. He stresses the importance of annotations as key to many of the improvements made in Java EE 5, and encourages developers to try out the new release.

In today's Forums,
kirillcool complains about incompatibilities between
SwingX and third-party LAFs:
"I'm not sure if you're aware of the laf-plugin initiative that has been started a few months back and has since then been adopted by four third-party LAFs (Substance, Liquid, Squareness, Pagosoft with Skin taking it in the next version). This initiative follows the core Swing mechanism of UIManager that puts all UI related information (delegate class names, UI defaults, fonts, colors etc) in a single place. This allows efficient decoupling of LAF and components. The LAF writer doesn't need to know about third-party components, while the component writer doesn't need to know about all LAFs. It's the LAF plugin that binds them together. However, since SwingX uses a custom mechanism for looking up the UI delegates, the SwingX components have a predefined set of core delegates. In order to provide set of delegates for other LAF(s), the SwingX code needs to be changed."

ilazarte responds to Bruce Tate's comments in Java Will Endure with the question
Is Bruce Tate Still Relevant?
"I keep looking at round tables like this, and I relate less and less to someone like Bruce Tate on a daily basis. I think he's been hammering several key points for a while now: 1. Java innovation is dead. That, or it must be mediated by his 'call to arms' to be more Ruby-like. 2. Ruby on Rails is an endpoint, and Java is a starting point. 3. Scripting languages will ultimately prevail over strongly typed languages. 4. We'll actually listen? 5. The 10 year language cycle. So now, for some musings of my own..."

Tom White checks out A Faster Java Regex Package in today's Weblogs. "dk.brics.automaton is a Java regex package whose main claim to fame is that it is significantly faster then all other Java regex libraries, including the one in the JDK. How can this be?"

Blarg #22: A Filter that auto-encodes session IDs on relative page links, Jayson Falkner writes:
"This is an example Filter that auto-encodes all relative links on a website using the HttpServletResponse.encodeURL() method. As with all my stuff, it is free for commercial and non-commercial use. If you like it, please remember to mention who originally wrote the code."

Kito D. Mann notes the end of an age in
RIP, Software Development Magazine:
"I've always been a fan of Software Development Magazine, which CMP recently announced it is killing. Of course, they say that they're not really killing it -- they're just merging it with Dr. Dobb's. Yes, you read correctly."

In today's
News Headlines

Registered users can submit news items for the href=""> News Page using our
news submission
. All submissions go through an editorial review before being
posted to the site. You can also subscribe to the href=""> News RSS

Current and upcoming Java