Thursday, 26 June 2008

Multithread debugging

Last years Netbeans performed an incredible evolution in functionality, quality, openness and integration. I remember those days of Netbeans 3 (when I refused using it), it had a very confused way of manage projects and it was a poor tool. It was not a very good choice, in my opinion, but there was a turning point at version 5 (or maybe other version). Nowadays I think it is the best tool for Java development. I have already tried many IDEs, but no one is like Netbeans. Of course there are weaknesses, no body is perfect, but it is a really good tool.

I was reading about next version (6.5). They are planning lots of fixes and improvements. But one of them particularly kept my atention: multithreaded debugging support. This is a dream for all developers who have already worked in a multithread environment. The matter is that, in "normal" debuggers, you can debug only a single thread, meanwhile lots of things happen behind you, in other threads. But next Netbeans version will bring us this shiny tool. Check some screenshots below:

You can choose what thread you are debugging at a given moment:


And there is a very interesting "deadlock detector":

To accomplish all these features, Netbeans developers had to change threading model. Some points are summarized as follows: (as found at Netbeans Wiki)
  • Default breakpoint only suspends breakpoint thread.
  • Step only resumes current thread when invoked and suspends current thread when completed.
  • Evaluation is done resuming the current thread (other threads unsuspended by default breakpoint or step). No deadlock caused by debugger might happen as far as no thread is explicitly suspended by the user (via suspend action or some breakpoint).
  • 'Step interrupted by a breakpoint' issue does not exist with default breakpoint. (Except the stepping thread itself encounters a breakpoint.)
For more details, check Netbeans Wiki

Monday, 23 June 2008

What is the future of android?

Wall Street Journal published an article on Android Platform, that is a project from Google and almost 30 partners and that has been delayed to the end of this year, while rivals like Apple and Blackberry go ahead.

I have just taken a brief look at Android, and maybe I am not the most qualified person to comment. But I note that changes in API are often and they make developers' work harder. Maybe they are just "adjustments" and will not happen so often in the future. And there is "the market", I mean, all mobile platforms around, including our famous JavaME, that Sun claims to be the "most ubiquitous application platform for mobile devices".

Well, I know Google is able to do amazing things. So we just have to wait, and the future will answer who is right.

Sun certification - SCWCD

Last week I took SCWCD exam: Sun Certified Web Components Developer for Java Platform, enterprise edition 5. And I was....approved!

The exam is a bit tricky. It is perfectly understandable that they do an exam hard to pass. If it is easy, there is no reason to people take the exam... :P There are some question you need to have good memory to solve, but almost all the time you have just to be logical.

I am already a SCJP (Sun Certified Java Programmer). I hope this new certification can be a good addition to curriculum.

Tchelinux

Tchelinux is the group of free software users in Rio Grande do Sul - Brazil. It is a group of people who freely give up of their own time to organize quality events about free software, development, tools, and so on. It is really nice what they do.

Just trying to explain what tche means: it is a very traditional and friendly way to say something like "dude". It is a symbolic word of this region in Brazil. The correct spelling is: tchê.

News about Desktop applications using Java

Sun is preparing a new version of JRE/JDK (version 6, update 10) with very interesting new features. Some of them regarding to desktop programs using Java. Yes, we have to admit that Java is not so popular at desktop side like it is at server side. But I guess things can change. Check this out:

  • Plugin deployment will be enhanced: this means that you will need to have only that part of java plugin that your application actually needs. Java runtime was never so large (considering what it does), but smaller downloads are always good...
  • Improved start up: performance is a key item and cold start up (when VM is started first for the first time) can take precious seconds (consider the user experience). So, next version will use disk cache to avoid perform a full cold start when a user start an application.
  • Graphics: enhancements like using Direct3D to acelerate most common operations. But what I really enjoyed was the new look and feel: Nimbus. I have to admit that I don't like ocean look and feel. So this is great news to me. And this new look and feel uses only Java 2D to draw its components, rather than using bitmaps. This means it can be drawn at any arbitrary resolution.
There are three ways you can try Nimbus look and feel (considering you have already downloaded and installed Java6u10)

  1. Hardly coding: insert line below into your code
     UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
2. Specifying
     -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel
on the comand line. Or

3. Adding the line below to the file JAVA_HOME/lib/swing.properties . This makes Nimbus default to your applications
     swing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel
Please check a Nimbus screenshot below:


Almost all information here is at java.sun.com

Note addressed to spanish speakers

Decidi escribir un blog utilizando el ingles, pués es una manera de garantizar que más gentes tengan la posibilidad de leerlo. Pero si quieres, puedes hacer comentarios en tu propia lengua española, que te voy a contestar en el mismo español.

Abrazo.

Note addressed to portuguese speakers

Pessoal,

Estou escrevendo este blog em inglês por um único motivo: atingir o maior número possível de pessoas. Estimo muito o nosso idioma e é possível que, ocasionalmente, eu escreva algo em português. Esteja sempre livre para comentários nessa língua, que eu responderei em português também.

Abraço.

Choosing correctly now, to be able to continue choosing later

This is the first time I have a blog and this is my first post in a blog, ever! I hope we enjoy (yes, both of us) this experience and we can achieve the objective of this blog: share information, talk about technology, being like a virtual bistro, where people can meet others and have a nice chat about interesting things.

Well, I was thinking about how I have come here. I thought about this blog during some time, I found a friend who encouraged me to do that (thanks Doug), I chose a blog name, I chose a blog service (blogspot), I used a computer with an operational system which I had already chosen, with a browser chosen by myself years ago, and son on... To be able to choose something is really, really important. But the best is that I could change my operational system, my browser, even my blog provider and I would still be able to have a blog and be here writing this text. Can you realize how cool is that?

Of course, every change has a price. But this price must be affordable. In every project I work, I always try to make correct choices (when I have this opportunity) to preserve the right of change, or the right of choose something different later. I know you do the same. But, sometimes, IT people, who are paid to make right choices for a company, design a kind of IT structure that will never allow that company to change in the future. I am talking about decide among different software solutions, design approaches, hardware specifications and all of these IT stuff. Sometimes an easier solution now, means a dark future.

Yes, I am talking about free software, open source, open standards, good design patterns. Of course you can choose a closed solution, if it fits better to your needs. We have to choose the best. Your company may consider that closed solution the best for company's needs. Sometimes that closed and expensive software can have unique features that your company really needs. In this case, I encourage you to choose this solution. But, in 99% of time, choosing open standards and open source is the best to the future. I know this is not only about open source, closed source. There are many other things you should consider, like support, costs of changing, design approach, training, and so on. But even considering that, I still believe open is better. Nowadays, almost everything has support. And if it is open, you have access to source code.

I am not defending open source software. I am defending freedom of choice. And I think open source software means freedom of choice. Of course I have my preferences (yes, I use linux!). And I support everything that shares knowledge. But this is not about philosophy. This is about business. And, is this area, things can change quickly. It is better to you to make the right choice now, to still be able to choose in the future.