March 29, 2005

Shiny New Toy on the Horizon...

Finally it looks like we might be getting something that I have always dreamed of.


http://java.sun.com/developer/technicalArticles/Programming/mvm/


I (among many others) have long wanted a way to reliably use a JVM as a true Virtual Machine. To be able to run multiple applications with only the overhead of starting one runtime. It should speed up Swing applications and make ridiculous java startup times a thing of the past.

It has always been feasible to go some way to achieve this kind of thing using a custom java application. This application would take several parameters at the command line:

  • The classpath for the application class to run.
  • The name of the application class to run.
  • Any parameters to be passed to the application class.
When the custom application class was run it would try to connect to a local socket trying to find a running instance of itself. If it found a running instance it would communicate the parameters for the application to be run over the socket and terminate. If it didn't find a running instance it would instantiate a classloader with the relevant classpath, reflectively instantiate the class from the new classloader and run it's main method, passing in the specific parameters. It would then continue running, listening on a socket for any more applications to run.


While this approach does a very effective job of reducing the footprint of running applications, it does not address the startup time (a new JVM instance is started for every application) nor does it properly isolate the applications (locales, system properties, System.exit() all combine to throw a spanner into the works).


I'm looking forward to playing with the research release of the MVM when it becomes available.

March 16, 2005

Evolution and Religion

Sorry about the length of time between posts, but I've spent an awful lot of time thinking about this post.

Recently I've been aware that several of my friends and acquaintances fall into one of two camps. One camp is the believers who feel that the theory of evolution is an argument used by others to attack the notion that God exists. The other camp is the sceptic who believes that the theory of evolution can be used to deflate certain of the 'absurd' beliefs endemic to most religions.

I happen to fall into another and much quieter camp, those who believe both in a religion and in evolution (whether Darwinian or a more modern form).

So, you ask, how do I reconcile the two?

My first thought is that God tends to use the most effective and elegant means of addressing his will. To my mind that means that there is no reason why evolution isn't the technique that God chose to use in creating the many and varied creatures on this planet.

Secondly I tend to take very seriously the assertion that God stands somehow outside of our conception of time. This means that to God it makes no difference whether it took 4 billion years of our time for us to evolve or we appeared in an instant. What matters is the result.

Something like evolution is almost required, because one thing that most religions are clear about is the importance of faith. Without evolution or its like, we would be able to point and say we know that a supreme being created us. Where would faith be then?

I also believe that there are reasons why we were created with intelligence; one of them is that we can start to approach an understanding of God (however slight an understanding), by investigating the marvellous universe around us..

March 01, 2005

J2EE Miconceptions - Part 2

Another popular misconception is around SQL and JDBC. I find that an awful lot of database specific SQL get written and a lot of it occurs for no good reason.

I would suggest that you go and read the 'Scalar Functions' section in the JDBC specification and then review all your SQL. I think that you will find a lot of the database specific SQL could be rolled up into generic SQL if you used these functions.

JDBC 'Scalar Functions' are by no means a panacea, but with judicious use you can seriously reduce the amount of DB specific SQL you are using which in turn will reduce your maintenance / migration burdens.