Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Java Newsletter - October 2004


Dr. Dobb's Java Newsletter - 10/19/04

Like a lot of people who work with technology, I’ve always enjoyed science fiction novels and movies. However, I often find it hard to suspend my disbelief when I read time travel stories. After all, the smallest action in the past would likely change something in the future (the so called butterfly effect). Larry Niven pointed out, that people changing the past would eventually change it in such a way that there were no more time machines!

You don’t need a time machine to ponder this mystery. For example, I once found a job only because I had answered a coworker’s phone (he had already taken a different job). Because of that job, I moved across the country and met my wife (we’ll be married 16 years next month). If I had not picked up the phone in my colleague’s empty office, my life would be unrecognizable – not necessarily better or worse, but certainly very, very different. It has always fascinated me that the slightest change in your past would probably radically alter your present-day life.

Consider this: At some point in your life, you decided to become a software developer. Well, I suppose that some people had a point in their life when they realized they had somehow become a software developer. Either way, have you ever wondered what you would be doing if you didn’t get into your current line of work? Sure, I wanted to be an astronaut, but that was never practical for a dozen reasons.

I have a suspicion that I might have been good at advertising. Frequently, ideas for commercials form spontaneously in my mind. I won’t bore you with my plan (or my lyrics) to have the Taco Bell dog in a sequined jumpsuit singing “Viva Gorditas!” I can’t hear an ad for Sirius satellite radio without thinking they should use the slogan, “Finally… radio gets Sirius.” And these are just the tip of the iceberg.

Of course, I don’t work for Taco Bell, Sirius radio, or an ad agency. So these are just my private little creations. However, I can’t help but wonder if I might have gone that route except for reading a book on computers in the local library as a kid, or some other seemingly innocent event.

Now here’s some more food for thought. Most software developers have to deal with “users” in some way (and many of us usually think of them with a little disdain). My ham radio friend George calls them the hoi poli, which I always find amusing. You can only wonder how many of the hoi– er, users might have been software developers except for some small event in their past?

I don’t know if Taco Bell or Sirius would appreciate my ideas if they heard them, but they might. We’ll never know since my only connection with Taco Bell is the occasional drive-through transaction. On the other hand, we usually get to interact with our users all the time. They might have a great idea about how our software should work. If we will only listen to them.

Another Java Lawsuit
Eastman Kodak is expecting a payout of more than US$1 billion after winning a patent lawsuit against Sun. A jury found Java infringed several patents Eastman Kodak bought from Wang Laboratories in late 1997. The patents in question are:

Patent 5,206,951: Integration of data between typed objects by mutual, direct invocation between object managers corresponding to object types.

Patent 5,421,012: Multitasking computer system for integrating the operation of different application programs which manipulate data objects of different types.

Patent 5,226,161: Integration of data between typed data structures by mutual direct invocation between data managers corresponding to data types.

(Hint: You can look up patents at http://www.uspto.gov/patft/index.html.)

In most cases, I am not a fan of software patents. In fact, the whole patent system appears broken to me, but that’s another topic. One of the factors for having a successful patent grant is that the invention be novel and nonobvious. The term nonobvious is the problem. The patent office is not in a good position to decide what software algorithms are nonobvious. I would guess that most of us would think Blowfish encryption is not obvious. I would suggest that using a button to fill in a form is obvious.

I used to copyright a lot of my software. I’m beginning to think I should start doing that again. At least with a copyright you could prove you did something before some big company decided to patent it.

Java 1.5 Arrives – Sort Of
Sun’s highly-anticipated J2SE version 5 is now available. Originally slated to be J2SE 1.5 (and code-named Tiger during beta testing), Sun decided to change the name, undoubtedly for marketing reasons. We’ll talk again about many of the new features later in this newsletter. If you want to read Sun’s take, head over to http://java.sun.com/developer/technicalArticles/releases/j2se15/. As usual, you can install the software from http://java.sun.com/j2se/1.5.0/download.jsp (you can even get the latest NetBeans IDE at the same time).

All Work and No Play
When I first started writing software, I disdained games as being beneath my talents. Of course, in those days the games were pretty simple affairs. I wish I had paid more attention now. Games are one area where even a small developer can make a big splash with the right product. Even a fairly large company is not likely to dethrone Microsoft Word, but a wildly successful game is at least somewhat possible. Of course, today’s games are as much cinematography, art direction, and music as they are programming, but games are big business.

Consider this: Microsoft couldn’t really kill off the old Win16 platforms until they could make games run reliably under Win32. The result? DirectX. The fact that Microsoft made such an effort to accommodate gaming should tell you something.

So even if you aren’t directly interested in writing games, you might find http://www.bytonic.de/html/jake2.html worth reading. This is a pure Java port of the Quake 2 game engine. Even if you don’t care much about games, it is interesting that Java is now at the point where OpenGL rendering and three dimensional sound is possible. This is also a great opportunity to peek at a significant porting project.

Tech: Java 5 Features
Before you rush out and download the latest J2SE, I thought you might like to review some of the features that the new Java 5 introduces:

  • Generic types – This is similar to templates in C++; you can write classes with generic types and then set the type when you create an instance of the class.
  • Improved for – A for loop can now directly handle Iterator objects.
  • Metadata – Additional data stored with classes, interfaces, methods, and fields.
  • Autoboxing and unboxing – The compiler can now automatically convert between primitives (like int) and their object-equivalent (such as Integer).
  • Static import – You can now import static constants from a class so you can refer to them without providing the name of the containing class.
  • Enumerated types – Like Pascal and C++, you can now define types that have a particular set of possible values (for example, you could define a type CPU with possible values x86, m68k, and atmega).
  • High-level concurrency – A new concurrency library provides tasks, queues, timers, locks, and semaphores. >
  • Variable argument lists – You can now write functions that take a varying number of arguments.
  • Formatted I/O – Think printf/scanf for Java.

Interestingly, many of these features aren’t revolutionary. But they do address many things that proponents of other languages have complained are missing from Java. Ada and C++, for example, have long hand generic types. Enumerated types are present in many languages. C, of course, is where the whole idea of printf (which requires variable argument lists) originated.

To Share or Not to Share
By Mark Glaser

If you have a 2-year-old child, as I do, you know that teaching the concept of sharing can be difficult. One day, he'll happily share his toys; the next day he's yanking them out of a playmate's hands. The software playground is going through this kind of tug-of-war when it comes to sharing code. Many Linux developers have been reared on sharing and collaborating, while large vendors, such as IBM and Sun Microsystems, are only comfortable sharing when it won't hurt their bottom line. Even miserly Microsoft has started sharing some code lately.

At IT shops, using open-source software is becoming a way of life for one big reason: it's cheap. Network Computing's recent special issue on “Affordable IT” started with the assertion that IT folks are "scrimpers, scavengers, and skinflints," and 85 percent of readers surveyed say they have to do some projects on a shoestring budget. While an InformationWeek survey found that 98 percent of IT people were extremely or somewhat satisfied with their Linux projects, they reported widespread problems with incompatibility, lack of technical knowledge, and poor documentation. A third survey by Venture Development found that retailers had only 2 percent of their point-of-sale systems on Linux.

In one of the more innovative code-sharing initiatives, a group of Minneapolis-based companies, including Jostens and Best Buy, started the Avalanche Corporate Technology Cooperative, whereby they will be sharing code in an online database to save development time and money. The group is using CollabNet software, and is coping with some thorny licensing and legal issues, a hallmark of sharing code these days, by using a special Avalanche license for donated code.

Meanwhile, IBM and Intel announced that they were sharing the code and specs for BladeCenter, creating an "open" server system to help software developers create compatible apps. And Sun recently elevated open-source advocate Bill Vass to CIO, while hiring open-source blog-software developer Dave Johnson. But Sun also has its limits with sharing, and told the Javalobby community to take down any Sun-copyrighted API documents from its new JDocs online repository.

Share and share alike as long as you don't share too much, apparently. My 2-year-old would feel right at home.
Source: TechWeb.com


Google Rumors
Many Java programs run with some sort of connection to a Web browser. The latest rumor is that Google may be preparing to release its own browser (maybe based on Mozilla or, perhaps, acquire a browser from another company). This isn’t as far-fetched as it might sound at first. Google clearly wants to expand its reach (as evidenced by their foray into Web-based e-mail). They’ve also apparently registered gbrowser.com and hired some key ex-Microsoft employees (along with a former Sun Java developer).

Apparently users are ready to embrace new browsers. There are many Internet Explorer “shells” like SlimBrowser, MyIE, and AvantBrowser (my favorite). These shells add features to IE. Opera has many loyal users and FireFox has apparently been downloaded over a million times even though it is still in prerelease. WebSideStory reports that IE usage is down recently (although in all fairness, only by a few percentage points).

If you write Web-based applications that interact with browsers in any way, this could be good news or it could be bad news. It is already difficult to accommodate different browsers, and adding one more isn’t going to help. On the other hand, a browser that gains popular momentum and was not as quirky as IE would be welcome by many and would probably drive Microsoft to improve IE.

Of course, so far, this is all rumor and speculation. Google has a good track record for creating things users want (maybe they listen to the hoi poli). I can’t think of another company that has a better chance of effectively competing with Microsoft’s IE.

Sun’s Arm
Arm and Sun announced this month that they will collaborate to bring Java to mobile devices using Arm technology. Arm is a well-known maker of embedded processors, and this alliance is expected to join Arm’s Jazelle hardware acceleration technology with Sun’s Connected Limited Device Configuration HotSpot Implementation to provide faster execution and startup times.

Next Month in Dr. Dobb’s Journal
In the December issue of DDJ:

Plug-Ins & Java - We use design patterns and concepts in the development of a Java plug-in framework.

Automating Batch Tasks with Ant - Ant is a good framework for automating batch processing of database functions.

Eclipse Validators - We present a validator plug-in that uses Eclipse markers and dialog boxes to display problems.

The Distributed Resource Management Application API - DRMAA facilitates the development of grid-enabled applications by offering a standard API for application integration and Java bindings.

Java Books Reviewed:
Tapestry In Action by Howard Lewis Ship - Tapestry is a component-based Java application framework designed as a replacement for JSPs and servlets.

Better, Faster, Lighter Java by Bruce A. Tate and Justin Gehtland - Hibernate and Spring are a fraction of the size of full-blown EJB, but can do most of the things that most programmers want most of the time.

Patents
Do you or your company patent your software? How do you feel about it? How can we fix the existing patent system for software in general, or even fix it so that it isn’t just a way for large companies to intimidate small ones? Drop me a line with your thoughts at [email protected].

In Closing
Do you use code review in your organization? If so, do you appreciate it, or do you find it a hindrance? Drop me a note and let me know your thoughts. You can reach me at [email protected] . See you next month!

 


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.