Monday, August 31, 2009

Review of "LWUIT 1.1 for Java ME Developers" by Packt Publishing [part 0]


Last week I received and answered an email from Packt Publishing. They wanted to know if I was interested to review their book on LWUIT called "LWUIT 1.1 for Java ME Developers". And I said yes, so the book is on its way to me.

Now the interesting part is that we, Marcel and myself, just recently decided to do all the dialogs in our game IFF using LWUIT instead of SVG. Most important reason is that we just can't get dialogs (forms) to work correctly on our N-Series phones. The cursor in edit fields doesn't move correctly, editing only works by switching to the ugly normal text-area input of MIDP.
Although the actual game graphics will remain in SVG, the dialogs (forms) will all be in LWUIT.

Marcel already followed the tutorial on the LWUIT site and is the expert between the two of us, I'm the novice. So I'll be looking at the book from that point of view. Without having written a single character of code that is supposed to use LWUIT I will start on the book and see if it helps me accomplish the tasks at hand... which will result in a series of blog posts.
Hopefully in the end you'll have
  1. A comprehensive book review on LWUIT
  2. A more complete version of IFF, which is now in beta if you're interested.

A little annoyance that's groing bigger by the day


Promise: Right after publishing this post, I'll file an issue!

So I have setup NB such that the import section and all JavaDoc is collapsed by default when opening a file. Why? Because it clutters my screen and I don't find it helpful to see all that code and documentation.
Since the IDE is doing such a great job in managing my imports and the code-completion shows all JavaDoc when I need it, I don't find it beneficiary to have it in plain sight when I don't need it.

But here's the catch. NB doesn't update the 'focus' of a file when I open it. What I mean is that when I CTRL-Click something in an editor and the source file is not yet opened, NB will open the file, jump to the correct location, make sure that the location is in the visible area on screen and then collapse all editor folds... moving the location of screen. And I need to scroll window to show what I want to see.

This is on NB 6.7.x on Vista at least. Latest updates of the JDK installed of course.

Update: It is filed as issue 171149.


Wednesday, August 19, 2009

Why Netbeans rules Glassfish... racing got me to this conclusion (part 2)

Well, last time I used this title I got some useful comments. Meanwhile I fixed my problems and in fact it was a race condition that I couldn't fix by using locks.

The problem I was facing had to do with the fact that I have a graph of objects that I maintain in a database. Adding a new object to the graph, means that certain objects would point to it as being a new neighbor. Which objects in the graph would get a new neighbor is determined by an algorithm that ensures that this process is 'fair' to the other objects in the graph.
When two or more objects are added more or less simultaneously to the graph, my algorithm would do the same thing and select the same objects that would receive a neighbor. One might argue that the system on this topic is truly stateless.
Anyway, I tried to fix my algorithm to not always pick the same neighbors, that didn't work. I tried to change my datamodel such that the system would be a little more lightweight, that obviously didn't work either. I tried to work with locks which ensured consistency in my model, but still no scalability on this end. I did some tweaking with transaction-scope and that fixed some issues. But finally I realized that I needed the EJB 3.1 Singleton which is not available in 3.0 so I mimicked part of its functionality by introducing a synchronized block on the smallest piece of code that suffered from the concurrency. This together with a smaller transaction scope fixed the problem.

But since that doesn't give me that warm and fuzzy feeling. Especially not since I know there's a solution in EJB 3.1, I'm now considering moving to GF 3 and use EJB 3.1 features. Of course all thru NetBeans' support for GF3 and EJB 3.1.

I'll keep you posted.


Wednesday, August 05, 2009

NetBeans 6.8 M1... first issue right after starting up


Thrilled after installing M1 of NB68 I fired it up and the first dialog was a disappointment. It didn't see that I have a NB67 installation, instead it asked if it was okay to import the settings of my NB65 installation. Bummer.

I reverted back to NB671 and will give NB68M1 a second try later today. Recreating all settings myself and will file a bug on it.