The Source for Java Technology Collaboration
User: Password:



Editor's Daily Blog

What Goes On

Posted by invalidname on August 31, 2005 at 07:45 AM | Comments (1)

Sanity checking simple code

Jeff Friesen's BlueJ article, posted yesterday, reminds me of one of my favorite tools when I was getting started in Java. In BlueJ, this is called the "Code Pad", a simple text area where you can input some Java code and execute it immediately. This allows you to test simple things, do some sanity tests, etc., without having to write a whole class.

This reminded me of the "Java Diddler", shown below, that shipped with Apple's Java SDK for the Classic Mac OS.

Classic Mac OS Java Diddler

The appeal of such a tool is that you don't have to write a whole class to wrap a couple of lines of test code and, depending on your workflow, pollute your history with the compiles for this test (it's always fun to discover later that the reason your code changes aren't taking is because you've blindly hit the up arrow in the terminal and re-compiled the wrong source over and over again).

Does such a tool matter when you're writing something like an EJB or some other object that's meaningless outside of its container? Maybe not, but those are the situations that cause problems for unit testing too, and maybe part of the reason we've seen a pull back towards POJO's and away from objects that are useless outside of potentially-complex, potentially-expensive containers.

By the way, are there little standalone compile-and-run scratchpads out there that you're using? Are they applications, applets, servlets, or something else entirely? This seems like a handy idea for a Dashboard or Konfabulator widget (hint, hint).


Chet Haase has a preview (with screenshot!) of things to come, in today's Weblogs. In Mustang, Swing, and NetBeans on Windows Vista: Looking Good! he writes, "I've been playing around with the Windows Vista Beta1 release lately, seeing how we're doing for compatibility and native look and feel. There are some minor issues that need to be fixed, but in general we're looking great."

Eamonn McManus has some tips for Compiling the JMX API in Mustang: "The Java SE sources are downloadable from java.net, and you can change and extend them within the constraints of the relevant licenses. But building the whole of Java SE is a major undertaking. Here's how to build just the JMX API. The same ideas would apply to building other subsets of Java SE that are Java-language-only."

In The next generation of languages, Malcolm Davis writes: "One of the first comments I heard when Java arrived was 'why are we still dealing with 3GLs?' Third generation languages (3GL) have been around a long time. 10 years later, there are still rumblings on why Java, and what is the next generation of languages."


In Also in Java Today, Thinking In Java author Bruce Eckel reviews Java Puzzlers, the top seller at the JavaOne bookstore, and uses his review as a springboard to explore some of Java's more pronounced fiascoes: "One of the most interesting aspects of the book is what these two, who are about as close to the center of the Java universe as you can get, quietly said at the end of some of the puzzle solutions, in their 'lessons for language designers.' Which is to say, 'if you are designing your own language, here's something you should do instead of what Java did.' Which is to say 'where Java didn't get it right,' in the gentlest possible terms."

Internationalization requires being able to show local character sets and format currencies and dates in accordance with local customs, but the big problem is how to dynamically adjust all the messages in your application to the user's language. This is especially tricky when dealing with dynamically generated messages, since different languages may require a different word order. Internationalization, Part 2, an excerpt from Java Examples in a Nutshell, 3rd Edition shows how you can deal with these problems in your Java application.


In Projects and Communities, the Portlet Community notes a new option for portlet deployment: Tapestry Portlet Support. "Portlet support is new in Tapestry 4.0. To a large degree, Tapestry has been re-architected to support portlets. Portlet support in Tapestry is native. This means that Tapestry is, under the covers, using the true Portlet API as it is intended to be used.

From the Mac Java Community: the Quaqua Look and Feel polishes the default Mac OS X L&F by bringing it more closely in line with Apple Human Interface Guidelines (AHIG). Improvements include better-aligned JComponents, alternating row shading for JLists and JTables, and more native-like JFileChoosers and JColorChoosers.


In today's Forums, snowbird0 has a problem with allocating huge stacks for Mustang. Setting the Java heap memory in the Java Control Panel clarifies: "I am not sure if I made myself clear: The Java Control Panel is completely unusable on Windows XP with heap memory configured at 256m - but that's the least problem. The bigger problem is that you just can't get enough memory."

In the Mobicents forum, ivelin has more thoughts Re: Google Talk conferencing: "Their dev site says that the call setup protocol is an extension of Jabber's XMPP, which they plan to document. Google also claims SIP and SIMPLE will be supported in a future version. As far as taking over the world, it will be very interesting to follow how Skype, Microsoft Messanger and Google Talk stack up in a year when they will all be SIP enabled."


In today's java.net News Headlines :

Registered users can submit news items for the java.net News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to thejava.net News RSS feed.


Current and upcoming Java Events :

Registered users can submit event listings for the java.net Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.


Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of java.net it will be archived along with other past issues in the java.net Archive.




Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • If you want the ultimate "Code Pad" for general Java work you should check out BeanShell:

    http://beanshell.org/manual/desktop.html#Editor_Windows

    You can use it as a shell, in a simple GUI editor window like CodePad, or embed it within your app. It's fully Java compatible but supports loose types as well, which makes it easier to write your little snippets.

    Posted by: pat on September 01, 2005 at 01:16 AM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds