Open Source J# Reborn As Ja.NET
December 23, 2008
Commercially I develop contracted software for clients based on the .NET platform, and C#. During my ‘free time’ I work on an application based on Java technologies (Java, Spring, Hibernate, and GWT). Sometimes I wish I could use one language for both my .NET and Java development. In the past this lead me to consider using J# for some of my .NET development, but somehow I never got around writing anything in J#. I finally lost all interest when Microsoft dropped J# from the .NET framework. So it was with great interest that I watched the rebirth of an open source J#, called Ja.NET.
Ja.NET is Java 1.5 Standard Edition (J2SE) that compiles MSIL for .NET. Ja.NET is derived from the Apache Harmony JVM. What this means is that all code written for Ja.NET can be compiled to .NET MSIL or Harmony Java bytecode. So far the developers have successfully built and ran JUnit, Xerces, Ant, and other OSS on .NET without any code changes to those distributions. Pretty neat!
Google Web Toolkit’s (GWT) Fake Long
February 24, 2008
I ran into a cunning Google Web Toolkit JavaScript problem, related to the Java long data type. I was using long for my objects’ identities, that are persisted to db4o. On the server side the objects’ identities had the correct values. When I returned the object as a serialized XML string, the value was also correct. But as soon as I tried to directly use long, the value was always one less, than the actual value it was meant to be.
Before I decided on long for my object identities, I had a gut feeling that JavaScript might not support this data type. Turns out my original suspicion was valid: “Intrinsic types byte, char, short, int, long, float, double, Object, String, and
arrays are supported. However, there is no 64-bit integral type in JavaScript, so variables of type long are mapped onto JavaScript double-precision floating point values. To ensure maximum consistency between hosted mode and web mode, we recommend that you use int variables.”
It probably would be a good idea if the GWT compiler reported any long types as warnings. There’s no point having a long that doesn’t really work. It just opens the opportunity for problems like this one.
Discovering Shoal: The Java Clustering Framework
February 8, 2008
I recently discovered an open source clustering framework for the Java platform, Shoal. What interests me about the framework is that it provides programatically controllable clustering for Java applications. I am definitely considering Shoal’s Java clustering for the next version of GhostBlade. For a few months I have been working on my open source project, GhostBlade. GhostBlade is an open source Java e-commerce application, based on db4o as the database, and Google Web Toolkit for the user interface. It’s not available to the public yet, but should be within the next few months.
What bothers me a bit about db4o is that it is primarily targeted at embedded applications, and does not really scale well to enterprise size systems. But I love it, since I’ve reduced my database development time by about 30-50%, and do not have to do Object Relational Mapping (ORM). The reason I’m thinking of using Shoal, or a comparable clustering framework, is that I’d like to build an extremely scalable enterprise level e-commerce application based on db4o.
I was thinking along the lines of adding the capability to create a clustered application where the administrator can partition the application based on its classes, and functionality. For example he can command GhostBlade to store the Order class on node X in the cluster, or the search feature must be handled by node Y. Whether this will be possible with Shoal’s clustering is requires some prototyping research. Watch this space for more on the db4o-Shoal clustering stunt.





