Click me! Home | Contact Us |
 

The purpose of this site is to provide resources for people using a single set of source code under both java and J#. More will be added to this shortly.

How full-featured is J# on .net 2.0?

First off I want to say that I think J# is a really well designed system. I think they made incredibly good design decisions in the architecture.

Everyone has their own needs so this question will be answered differently for each person. Here is my summation of what is missing:

  • Implement java.text.ParsePosition.getErrorIndex(). This is needed to determine where in a parsed string the problem exists. And it is also the only know way to verify that no error occurred.
  • Implement java.net.DatagramPacket.getOffset() – I am assuming that in the case of J# it would always return 0 so it should be easy for them to add this.
  • Support Throwable.initCause(Throwable cause), and Throwable.getCause(). This is key for two reasons: First you want to throw a specific exception, not a generic Exception so the programmer know what happened. And in java you must declare what you throw so setting everything to throw Throwable is a horrible mess.
  • Support the Locale constructor Locale(String language). There are cases for many applications where you know the language but no country is set.
  • Support Boolean.toString(boolean). In fact, it should support all 1.4 methods in the primitive wrappers String (including the regexp), Integer, Boolean, etc. – and StringBuffer.
  • Having System.Object/String and java.lang.Object/String be the same class is fantastic. And the java.lang.Throwable -> System.Exception works well – it’s a bit weird in places but that can’t be helped. I don’t think it would work without this equivilence. But it would help a lot of this held for the other primitive wrappers – I hit a problem because System.Boolean != java.lang.Boolean.
  • Documentation for the classes and listing the methods in the classes J# doesn’t support (ie exist but throw a NotSupported exception).
  • An equivilent to nunitaddin but it will run junit instead of nunit and will run the main program in the class on.
  • A nant command to run junit tests.

And here are what is actually the biggest pain of developing in J# - and it's not J#:

  • The functionality in ReSharper/IntelliJ is incredible. Especially the refactoring and the showing errors in the source as you are editing. Unfortunately ReSharper is not designed for J# and so I am left feeling like I am back in an earlier age of programming. You don’t realize how much tools like this help you until you have to work without them.
  • In the Project Properties I can set the default package to be nothing. But it then creates a package name of .net.windward instead of net.windward
  • Add an existing folder. Copying code across is a PITA because you have to create the folder structure first through VS2005 – then you can copy the files and add existing classes.
 

We need You!

If you are willing to convert JFreeChart to a J# version (like the other programs in J by J#), please email david@windward.net. We have libraries to assist with this and it would probably only be a 1 week effort.

Support forums

Libraries you need in .NET

What else?

If you have anything else that would be useful for this page, please email david@windward.net. I will be adding more myself also.

Helpful hints

  • You can cast from byte[] to ubyte[] and back using (Object) as an intermediary. to cast ubyte[data] use "(byte[])(Object)data".
  • All of the codepages appear to be supported in the String and Reader/Writer constructors. However, not all of the names java supports are there. So "windows-1252" fails but "Cp1252" works. It's a pain to convert to the encoding names supported by both - but they do exist for each encoding (I think).
  • Don't use TreeMap - it's broken.

Common ADO .NET layer

I am working on an API that provides a common set of calls for all ADO .NET providers. The big problem it addresses is parameters in selects. But I include abstracting out the DbProviderFactory as not all clients support it (MySql) and providing a call to enumerate servers and databases on servers in case other vendors support this, but not through the client.

This code is at a very early stage and presently only supports SqlServer. If you want additional support now, add it and let me know - otherwise please wait until I get to it. We should have support within the next 4 weeks for Oracle, MySql, and DB2. We probably won't do any others.

The code is here.

eXTReMe Tracker