What’s the future of Java in Notes/Domino?

At Lotusphere 2007 there was a session on the future directions of Java in Lotus Notes and Domino called AD508 (AD508: Java 5 Upgrade for IBM Lotus Notes and Domino). Basically the session discussed the future of Java in Notes/Domino and how IBM is planning to ship Java 5 as part of Notes 8/Domino 8. Unfortunately I haven’t had the time I wanted yet to play around with version 8 yet so I cannot comment on whether Notes/Domino 8 already has Java 5 – the Reviewers Guide says that it has though.

For those not in the know Java 5 introduced a number of new core language features which are definitely worth the upgrade but the most beneficial for me is the enhanced for-loop and generics. There are a number of additional API changes that makes life much nicer from the programmers point of view. This is all well and good but Sun Java is currently in version 6 and have been for a while now and Java 7 is currently being planned and scoped out. Java 6 has a number of additional features that would be nice for Notes/Domino programmers such as JDBC 4, new APIs for web-services and improvements to the Java Platform Debug Architecture (JPDA). Only going to Java 5 in Notes/Domino 8 seems like a bad choice.

Why would IBM not want to go directly to Java 6? It could be that, as of today, IBM hasn’t shipped a Java 6 development kit yet and since IBM probably wants to include their own JDK it might be why. Another reason could be that IBM Lotus Expeditor doesn’t run on a standard JDK but on the IBM J9 VM which is a scaled down version of the JVM with a limited set of API classes. With not even a Java 6 JDK ready I would guess that a Java 6 version of J9 is a long way off. The fact that Lotus Expeditor is based on J9 causes its own set of problems for plug-ins in Sametime 7.5 (as previously mentioned) but that’s another story.

I fear that since Lotus Expeditor now is the base platform for IBM client products and since IBM probably wants to avoid shipping two JVMs with the product they will stick with J9 for some time. Given I don’t know the exact technical reasons for J9 and there are performance to think of as well (JVM reuse for client platform code and client side Java) I find that a real shame. It would be a really big loss.

Suddenly the supported Java version will be tied to the JVM running the client and we as developers and customers will be tied to using back-level APIs. For trivial agents etc. this is probably not going to matter anyway since the Java API hasn’t been updated since its inception. For new code it is going to be a real show-stopper. Most new code and components are created by combining existing (open-source) modules into new code and modules and with most open-source projects being at at least Java 5 by now it is going to cause problems. I know Java 5 and Java 6 are bytecode compatible but requiring additional compatibility libraries are going to be a problem in the long run. Combining this with the Java security restrictions put in place we can find our self running on a monolithic IBM Java platform which hardly was the idea.

So what’s the answer?

It seems more and more like IBM should support custom JVM for at least the server. It would be nice for the client as well but lets be reasonable. It could a solution where there are a number of choices – some choices could be proven and (absurdly) battle-tested (Java 1.3, Java 1.4.2) and some simply following the industry (Java 5, Java 6). I know it probably never will be possible to simply drop a new run-of-the-mill Sun JVM into Domino but this isn’t necessarily the goal. I simply want a JVM that follows along. It might be that it required an additional download and install but at least give me the choice.

As for the Notes 8 client it might be even easier than for the server since the Eclipse foundation already allows for a custom JVM. Why not support running Notes 8 on an already installed JVM? One could even argue that the client would benefit just as much from a JVM upgrade than the server since the Notes 8 client will be a universal client and hence not simply access Notes data. If IBM expects ISV’s to develop Java solutions for Notes 8 they will expect a common programming model for Eclipse/Notes 8 based solutions which comes down to the JVM.

So IBM – please upgrade the JVM or allow for “custom” JVM’s – soon… Oh – and please upgrade the Notes/Domino Java API – who still uses java.util.Vector? Thank you! 🙂

Properties as top level members of script libraries

Is anyone actually using the possibility of defining a Property as a top level member in a LotusScript script library? Apparent you are able to define a property as a top level member of a script library just as it is possible with a Sub or Function. The below code will actually compile and run (“SomeProperty” is not a variable but actually a Property defined in the Declarations section).

Sub Initialize
   SomeProperty = "HelloWorld"
   Msgbox SomeProperty
End Sub

Below is how the code actually looks in Domino Designer with “value” being a String variable defined in the Declarations section. Although possible I wonder if anyone actually uses it as I think it makes the code a little difficult to read.


Beware of object scoping in Visual Basic

I’m doing some Visual Basic programming in Microsoft Word at the moment and spent some time on Friday trying to find out why all my objects (based on a Visual Basic class module) apparently had the same values. Apparently the following doesn’t work:

Dim col As New Collection
Dim i As Integer

For i=0 To 10
  Dim obj As New Person
  obj.Firstname = "Firstname" & i
  obj.Lastname = "Lastname" & i
  Call col.Add(obj)
Next

If you run the above code all the objects will hold Firstname10 and Lastname10 in their class variables. The solution is to do this instead:

Dim col As New Collection
Dim obj As Person
Dim i As Integer

For i=0 To 10
  Set obj = New Person
  obj.Firstname = "Firstname" & i
  obj.Lastname = "Lastname" & i
  Call col.Add(obj)
Next

The difference is that in the latter example the definition of the Person reference is done outside the loop while both the definition and the instantiation is done inside the loop in the first example. While both of the above cases are quite okay in LotusScript, and works as you would expect, you apparently have to define the reference outside the loop in Visual Basic for it to work. Why that would be the case is unclear to me…

Oh well… 🙂

Microsoft Exchange protocol has been opened up

As you might have heard a number of Microsoft proprietary protocols has been opened up (incl. the protocol used for Microsoft Exchange Server) as reported on Slashdot and on Redmond Developer News. This would make it possible, as actually mentioned in a Notes 8 session at Lotusphere 2007, to make Notes 8 a client for Exchange since the Notes 8 client (read Lotus Expeditor) is actually very generic.

But then again who would want to run against Exchange Server? 😉

Via the Java Posse episode 110.

Anyone who have used the Deftype statement in LotusScript?

While looking for something completely else in the Domino Designer 7 Help I stumbled over the Deftype keyword. I find it hard to find any usage for it but then again I always code with Options Explicit/Declare and type all my variables but still… Anyone who have actually used it and can give an example?

Deftype Statements
Set the default data type for variables, functions, and properties whose names begin with one of a specified group of letters.
.

Problem managing your feeds? Look to the dinasaur report!

At the blogger BOF at Lotusphere 2007 a question was asked as to how one keeps up with all the blogs. The first part of the answer is to use a feed reader such as FeedDemon and the other part is to clean up regularly. Since it can be a problem to know which feeds aren’t updating you need some kind of tool. Again FeedDemon comes to the rescue.

I just upgraded to FeedDemon 2.5 Beta 1 for one feature, and one feature alone – the Dinosaur report. I installed the beta over my existing FeedDemon installation and loaded up the report and man have I been waiting for this! The report shows you all the feeds that haven’t been updated in a certain period of time and lets you easily unsubscribe from them. The report can be adjusted to show feeds that haven’t updated in 10, 30, 60, 90 or 120 days. This simple, yet powerful, feature allowed me to quickly unsubscribe from 76 feeds that haven’t been updating in 90 days. Nice!