2007-02-14

The Power of the Community

It isn't new, other have already said it, but today I found another demonstration of the Power of the Community. A Community of motivated people created many successful software projects, like the GNU/Linux project. When the idea for a new project appears and a community builds up around it, the project at such a pace that commercial companies would say it is impossible. In fact, when the community that is developing an application that they will use it, magic happens.

Today I was browsing through the web when I came across this set of videos on YouTube. It is about the Jokosher project. What is the Jokosher project? Well, I'll quote its home page:
Jokosher is a simple yet powerful multi-track studio. With it you can create and record music, podcasts and more, all from an integrated simple environment.
It may not sound that great, but this application was built like every application should. And is moving at a quick pace because of the community that surrounds it. But back, to how the application was built. First they laid down their requirements. They also chose the tools they wanted to use, because they were the developers. Next step was to male lots of GUI Mock-Ups. Incredibly enough, someone decided to code one of the mock-ups, but nothing actually worked underneath it. Well, the Community stepped in and Jokosher is being developed at an incredible pace. In fact, LugRadio is being recorded with Jokosher, since it was the driver for the project.

This project is a living proof of what a community, and humanity in general can achieve if people set their minds to something. Believe me, this is not something you can force upon a group of people. No, the software won't come out faster the more under-paid persons you throw at it. Actually, even with over-paid persons it simply won't work. You need motivated persons, a sense of community to drive a project. Building this community is hard, specially in commercial projects. In fact, I believe that for commercial projects things are even harder since a motivation is hard to build and easy to destroy, but that is a whole different story.

2007-02-10

Finally a API for Date and Time Handling in Java

Have you ever had to do real work with Dates and Times in Java? Well, I had to and still have to. For Data and Time handling the Java API includes the Date and Calendar classes, but these classes leave a lot to desire. For instance: there is no class that represents a Date without Time information, or a class that represents Time without Date. Even worst, there is no class to support Durations. Until know what I did was to create the classes that I missed. For instance: I created a Duration class that represents Durations. It is weird to have to do these things, but it is a fact of life if you want to use Java Standard APIs.

But there is hope for the rest of us that really want a new and better API. JSR-310 Date and Time API is planed for Java 7 and should address these issues. They will finally create a simpler API, with all the missing parts like Durations, Date without Time and Time without Date, and so on...

The problem is we are still at least a year away from Java 7 and we need to develop applications now! What can we do? Well, when I found out about JSR-310, I also found out about Joda Time. This is an API that fills the gaps in the Standard Java API with a license that we can use even in our commercial applications. In fact, JSR-310 will take ideas from the Joda Time API, fill some gaps and address other issues: nothing more. It won't be a copy of the Joda Time API, but it should be a simpler version.

From what I saw in Joda Time API, I will definitely consider it whenever I do code that involves Dates and Times. The problem will be convincing management that we should adapt some of our existing code to use this API. But who knows: there might be some severe error in our code that using Joda Time would solve. Well... I'm wishing out loud. The facts are that we currently don't have time to breath, just time to write the simplest code that guest the job done, no matter if the code is the ugliest hack every written!

A Departure...

My grandfather has left this earth and went into the great adventure. He will always be in my heart and I'll never forget him. I know he is watching over us and he expects us to continue without his presence. I'll do my best to make him proud...

2007-02-05

ARM, Symbian, Linux and the iPhone

I've been a little off-line lately due to some personal problems It involves the health and life of someone that is dear to me. This leaves me without any will our power to actually write anything. But at least I'll leave here a link to a series of articles on the story of the ARM processors, the Symbian and Linux use on Mobile Phones. And of course, the latest release from Apple the iPhone. Read on if you want to know a little about history, since my will to write is somewhere else...

2007-02-02

Filling the Gaps in Swing...

I had this subject on my backlog for quite some time. You see, I started my days as a professional Java Developer doing Swing coding. At that time Swing was OK, a little slow, but OK. Today I believe Swing is as fast and any other GUI Toolkit for Java with the advantage of being extremely flexible. But I don't want to get into a GUI Toolkit debate here because I think there is nothing to debate: you weight the factors for the project, choose a toolkit and live with it.

In the last couple of days I stumbled upon two very interesting Java Specification Requests (JSR) related to Swing The first and oldest one is the JSR 295 - Beans Binding. The second one is the JSR 296 - Swing Application Framework. I already heard about the first one a year ago and I actually thought it was dead, but there has been some progress. These JSRs fill some of the Gaps I always believed Swing had. I'll give you some details.

The Beans Binding JSR finally turns Java Beans into something really useful. The idea is simple: you have two Java Beans and you want to bind their properties. You want that when property X of bean A is changed then the property X of bean B is also changed. Of course that you want this binding to work both ways. Simple in principle, but easy to do? Probably not, but look at the potential: you have a JTextField and its "text" property; you have your own bean, Person, with a "name" property; you simply bind the two properties together and voi lá: the name of the Person is displayed in the JTextField and when you update the JTextField the name of the Person is also updated.

JRS 295 - Beans Binding goes far beyond this simple Use Case I described, it even has an expression language for complex operations and artificial properties to help use the Swing components more effectively. For instance: the JTable class has an artificial "elements" property that represents the rows in the table - this way you can bind a list of objects to a JTable. If your curious check this blog entry and dig in.

Waht about JSR 296 - Swing Application Framework? How should I put it: if you didn't do something similar yourself when you developed your Swing interface that you're in real trouble!!! Let me explain: Action management is something that you must learn if you want to make a clean Swing Interface. Don't know what I'm talking about? Well, you're in real trouble. I'll help you: I'm talking about extending the AbstractAction class. It may seem strange but the idea is simple: you create an action and use it for your menus, buttons and pop-up menus. This way you have only one point on your code where you define the icon for the action, the text, the tool tip, the accelerator key and so on. When you add the action to a menu Swing will automatically take advantage of all the properties. When you select the action, be it in an application menu bar, pop-up menu or tool bar, the same actionPerformed method is used: the one of the action.

But believe me that you loose some time creating the structure to get your Actions well together, specially if you want to have ActionMaps and the standard Copy/Cut/Paste actions. And there comes JSR 296 to the request. With it you simply annotate the methods that are supposed to be actions and it takes care of the rest. Even the GUI builders like NetBeans Matisse will support this.

But the JSR 296 goes beyond this and it event provides support for background Task execution with the same @Action annotation. These background tasks can also provide a progress status and messages that can be displayed in a Status Bar. But another interesting thing is the support for Resource Management. The idea is that instead of setting all properties of a Swing component when it is created you simply set is Name property and then the resources define the rest. For instance, you set the name of a JLabel and in the resources you can define the value for its Text, Background Color, Icon, Orientation properties, or any other property for that matter. This keeps code clean of any string or resource that doesn't belong there.

For more details on JSR 296 - Swing Application Framework, check its development site, specially the introduction.

Now, if you're just on of those Eye Candy Lovers you can have a look on how the new Progress Dialog for the Java Plug-in will Look in the Java 6 Update 1 or Java 7. Now you have something decent to show your users when they are waiting for an Applet to load. In fact, you can even set the image you want to show.

2007-02-01

Three Pages, Three Weeks, Three Radars...

Today I made some progress on my Thesis: I was able to write three more pages in just one hour. At this rate It will take me another sixty hours to finish it. Hmm.... that still seems a huge number...

On another note it seems that the number three has been pursuing me all day and will continue to. Let's have a look: I passed by three police Radars on my way to Work; the promise made by the high level management of providing us with full details on a sensitive subject within three weeks saw its deadline today (no, as usual they failed one more promise; why am I so stupid to think otherwise?); I found three major errors in the source code I was changing at work (don't worry, the errors are still there, since there is no time to correct them); I passed another three police radars on my way to the University; I have written three pages of my Thesis;... What will be next? Three Speeding Tickets when I get home?