Sunday, April 26, 2009

Sun acquisition by Oracle

I thought that Sun would be acquired by IBM two years ago or maybe earlier but I never imagine Oracle as a potential buyer. People seem to be concerned about the future of Java but I believe that any company would do better than Sun Microsystems in terms of management, vision, strategy and business model.


J2EE


Oracle acquired BEA last year and got WebLogic and JRockit JVM among other products. WebLogic seems to be the most respected application server right now, many big companies are running it. Medium to small companies tend to use JBoss most of the time. Some Glassfish v3 features could be incorporated into WebLogic. Why would Oracle invest into Glassfish? I don't see any compelling reason.


NetBeans IDE


My only concern is about NetBeans. I have no interest for Eclipse and JDeveloper. JDeveloper is a decent IDE for Oracle products. It looks very good for J2EE development and Oracle Centric stuff. I don't find the product very usable in general for anything else but J2EE (text editor, usability, plugins, etc.). I tried the IDE couple of times for the last 3 years and always went back to NetBeans. I suppose that Oracle will be merging interesting JDeveloper features into Netbeans instead of the opposite.


Oracle and MySQL


Oracle will probably incorporate whatever features they think are worth into their database and let MySQL be handled by the community. After some time, MySQL will rest in peace.


Java on the desktop


Will Oracle kill JavaFX? Right now, I don't see what's worth in JavaFX. Yes, next generation of applications, declarative programming, etc. Yes, they might be able to fix some design mistakes and bugs that they can't or don't want to fix in Swing. There are no official JavaFX binaries for Linux, Solaris, FreeBSD. Still those demos about circles, balloons and such. I don't see JavaFX as a competitor of Flash or Silverlight at the moment, it's way too immature right now. If the JWebPane component was ready, JavaFX would've gotten more interest, that's for sure. People would be like ok, we don't mind wrapping some swing widgets in JavaFX most of the time and now we've got a true web browser component.


Unix


IBM has AIX and Oracle will get Solaris. Sun improved their marketing strategy. They revamped the website which was awful before 2003-2004 and starting to put the "Java" trademark everywhere especially where it doesn't belong. In Solaris, some applications appeared out of the cloud, "Sun Java Browser" aka Mozilla, "Sun Java desktop" aka Gnome, etc. Solaris is still used by some companies as a server but it is barely used as a Desktop OS. The package management seems to have improved in the latest builds, but a project like Nexenta OS , basically Debian on a Solaris kernel is more promising on the Desktop.


What about IBM?


I am wondering now how IBM fight Oracle with the Java technology. They already made a move in the database market with EnterpriseDB. They have a JVM, a desktop toolkit, they are strong with J2EE(Websphere) and they have a bunch of developers/consultants.


To summarize it, I think that the future of Java is in good hands with Oracle. It will be interesting to see the vision/marketing switch when Sun acquisition is complete.



Saturday, March 21, 2009

Thoughts about JavaFX

JavaFX has the potential to become something interesting. While there are many articles written about JavaFX, I have yet to see a non trivial JavaFX application. When browsing Dzone articles, it almost looks like JavaFX is popular, while it's not.


There's no amazing UI control and I am not sure that I could code an entire JavaFX application without writing few java classes. I am not fond of applets and I haven't written any for years. JavaFX doesn't solve the "applet problem".


I don't know about any cellular phone which is officially supporting JavaFX. I am also not aware of any software vendor distributing desktop applications written with that technology.


In my opinion, JavaFX is not ready for production use. What motivated the release of JavaFX? Maybe they've been advertising it for too long and they had to release something. I'll give JavaFX probably one more year before attempting to use it.



Sunday, January 04, 2009

serialVersionUID in Netbeans

Most of the time, I use Netbeans when I have the choice. What I don't like about Eclipse and is getting me worried time to time is when the IDE freezes for a long time when you're not really doing anything.

Last week, I needed to build a simple Java project (Maven based build), about 50 000 lines of code(from sloccount). The project contains one core project and few sub projects. Eclipse took about 30 minutes to import the project and set up the classpath. That performance was achieved under a Quad Core, 2 GB of RAM, which is amazing. I had only Eclipse, Firefox and a terminal opened. I tried with both q4e and m2eclipse plugins, same results, I could hear my CPU making lots of noise. I had time to start cooking, boil water for coffee and do some other things, before the IDE was ready to use.

One of many missing features in Netbeans is the ability to generate the serial version ID for a serializable class. With Eclipse, you get the warning all the time, and you can choose between:
  • ignoring it
  • adding the annotation @SuppressWarning("serial")
  • generating the serial version id.

Available plugins for Netbeans
There are two plugins available for Netbeans, that I am aware of : UUIDGenerator and serialVersionUID generator. I only have success with UUIDGenerator (most of the time, I am running the latest development build under Linux and Windows and lately Mac OS Leopard).

Enabling Serialization warnings
Under Tools->Options->Editor->Hints->Standard Javac warnings, select Serialization. That way, you'll see a marker notifying you that you're missing the declaration of a serialVersionUID field.




Generate the serial version ID
You can generate the serialVersionUID using the shortcut Control-ALT-Z. You can copy the generated contents to the clipboard and paste it inside your class.

Tuesday, December 23, 2008

Merry Christmas

XPontus and VFSJFileChooser were released this evening. I wanted to release before Christmas! Still the same stress and anxiety before and after publishing a new version. Now, I need to start advertising in forums, etc.

The last few days, well more nights than days, have been mostly about testing XPontus installers, fixing bugs, reviewing as much code as I could.

Merry Christmas everybody and happy new year!

Sunday, December 14, 2008

Stepping down

I'll stop working on my Open Source Projects in 2009 and focus on starting my own first company. The company will be created in early 2009 and will be focused on Java development(desktop or web). I still have to think about what I'll do exactly at the beginning.
OSS development has been a great experience so far. I learned a lot and I met lots of interesting and talented people. I thank everybody who helped me while working on XPontus and VFSJFileChooser (comments, patches, etc.). I got some things right, some other wrong, but the interest of the community kept me motivated all the time.

I've been working a little bit on XPontus XML Editor this weekend. There will be a maintenance release. I intended to solve the following issues :
  • Unreadable white tabs in Windows Vista and the ugly fonts which are not antialiased.
  • XPath2 support is there too.
  • Basic XQuery and XSLT2 support maybe if I have time, that involve a partial rewrite of the "User transformations manager", to specify the specific processor
  • VFSJFileChooser will maybe make it. It will be an alternative to the standard JFileChooser. Users will be able to select the default file browser and ignore VFSJFileChooser.
  • UNC path for windows bug, unable to save correctly the file. I'll try a simple fix on this one, but cannot guarrantee that it will be tested a lot.
  • Other issues if possible

VFSJFileChooser will also be out soon, with couple of bug fixes and usability improvements.

I will try to make the new releases of XPontus and VFSJFileChooser before focusing on my company.

Thank you

As I used to do, here's a screenshot of the XPontus development branch on Windows vista.



Tuesday, November 25, 2008

Handling database changes without complete migration

The ORM market
ORM tools are great. Products like Hibernate, JDO, JPA, IBATIS, Torque, and others made life easier for developing database enabled applications.
Using JDBC when your application is database intensive with lots of table can be lots of work especially if lots of your existing code base doesn't provide some DAO classes.
Usually in ORM tools, you map a set of fields to some columns, using XML or annotations, and you're done.

Most J2EE and core Java developers have faced database changes and migration issues at least once. The problem is pretty crucial when your database model is shared by other applications which can't be upgraded(for many reasons).

The concern
  • How to handle database changes which keep happening?
  • Should/Could you stop providing backward compatibility?
  • Is upgrading the database model your only solution?
The application history
  • You have an existing application with a model which has been designed carefully and everything is going well.
  • You have a server side application with a database model and client applications with the same database model as the "main server".
  • A month or a year later, you need to make lots of changes in couple of tables, replace some primary keys, introduce some non null foreign keys, etc.
  • You were using raw JDBC mostly and plain SQL. Now, you would like to use that brand new bleeding edge technology(Hibernate, JPA, Ibatis, name it).
  • Here and there, you might have been using a very old ORM tool which was convenient at the time and is still getting the job done.
Constraints
  • You need to be able to support simultaneously clients(applications) running older and newer versions of the database schema.
  • You cannot force the customer to upgrade for many reasons(hardware dependencies, partner application compatibility, the customer doesn't want to, etc.)
  • You need to keep adding new features which might involve altering again the existing schema
  • Your table contents are now messed up, invalid or irrelevant values here and there because the database column has a "NOT NULL" property.
Possible solutions
  • One might be tempted to maintain different versions of the same database, but let's say I have 100 versions since 1994.
  • Ok, let's use JCR to provide another abstraction level, maybe checking a node property before deciding which class to map, overkill in most cases?
  • "Dear customer, please, upgrade and buy the new pack to be able to use that version which also provide bug fixes and new features"
  • Hum... last resort "Dear customer, you should upgrade because that X, Y, W feature fixes lots of serious security holes which will affect your network"
  • Ok, from now on, every table will be like a key-pair, probably not very wise most of the time, especially if it will involve rewriting most parts of a huge application.
The problem is here, a fix must be delivered!
What I would probably do is :
  • Stick with raw SQL and migrate ORM mappings to JDBC, as needed(if the ORM tools cannot ommit fields), to ignore some properties depending on the client database version. I can insert some dummy values when I have no choice when dealing with "old software clients".
  • Use native SQL queries and JDBC only
  • Use named SQL queries with binding and anything tool that supports it Hibernate, Ibatis, a resultset handler from JdbcTemplate or DbUtils, etc. Some dummy data will need to be inserted when not available(new non null columns).
  • If the problem gets out of hand, way too many changes, I'll probably want to use a non relational database and handle relationships myself(An object or XML database might do, but might not scale)
  • Another solution, would be JCR. I messed with JackRabbit once, and the pain was brought. Performance, concurrency and the API probably improved since then.
I would definintely try to avoid running multiple database versions at the same time. You can easily go from 1, 2 versions and then reach 100.

What would you developers do in such a situation?

Sunday, November 16, 2008

JDK7 changes

I had a surprise this morning while playing with System.getProperties. I am using JDK7 and displaying the system properties in a Swing JTable.
When I don't specify the number of columns I get a null pointer exception. It happens when populating the array contents, not at initialization.
This will throw a NPE:

data = new Object[NB_ROWS][];

This will not

data = new Object[NB_ROWS][NB_COLUMNS];

Code excerpt

public JavaEnvironmentModel()
{
Properties envProperties = System.getProperties();
NB_ROWS = envProperties.size();
data = new Object[NB_ROWS][NB_COLUMNS];

// for google blogger parser, no generics(Entry)
Iterator it = envProperties.entrySet().iterator();

for (int i = 0; it.hasNext(); i++)
{
Entry entry = (Entry)it.next();
data[i][PROPERTY_COLUMN] = entry.getKey();
data[i][VALUE_COLUMN] = entry.getValue();
}
}