Jens Bruntt on Java vs. LotusScript

We asked SearchDomino.com Web development expert Jens Bruntt, "What are the advantages and disadvantages of writing a Java agent over a LotusScript agent?"

Jens Bruntt
This tip is the third in a series of expert responses to a SearchDomino.com developer discussion forum question: .mgn7axGcQYd.3@.ee7740b/16703!viewtype=threadDate&skip=&expand=>What are the advantages and disadvantages of writing a Java agent over a LotusScript agent? We asked SearchDomino.com Web development expert Jens Bruntt for his opinion on this matter. View the original question in the forum and let us know what you think!

See what SearchDomino.com application development expert Brian Mahoney and Domino development expert Andre Guirard had to say about Java vs. LotusScript.

View member feedback to this tip.

Advantages of Java
In my opinion, the primary advantage that Java has over LotusScript is its support for network-enabling your agent. Your agent can get a resource on the Internet and do things based on what it finds.

Here's an example: I have a customer that wanted to display stock information in its Lotus Notes client-based portal. They wanted to display on the company Web site what the current bid/ask price was and if the price was going up or down. They already had a subscription with a stock information broker that delivered this kind of information as an XML file available on the Internet using a special URL. For the portal, we created a Java agent that connected to the XML resource every five minutes and dumped the contents into a Lotus Notes document. The rest was @DbLookups from a Page in Lotus Notes.

If I were to create the same functionality in LotusScript, I would have had to do Windows API calls on the server. Had my customer been running Unix on the server, I would have been unable to do it using LotusScript at all.

Also consider the Java language itself. The language has a lot more classes, functions etc. available than does LotusScript. And if you can't find a class that does what you need, you will probably be able to find it available for free on the Internet. The Java community is bigger than the LotusScript community.

Advantages of Java that aren't really convincing
Then there is the standard advantage that you often hear about: Everyone is moving towards Java and eventually LotusScript will disappear. Well I really don't buy that argument. IBM and Lotus have a tradition of taking care of backwards compatibility. If your application was originally created in Notes 3, it's actually quite a safe bet that it will also run on R7.

Disadvantages of Java
The greatest disadvantage that Java has (in the Notes and Domino context) is the lack of a proper development environment. Debugging is a pain. If your agent is to live in a Notes database, the obvious place to code it is in the Notes database. But then you are left with debugging in the way that you do it when coding with @Formulas, printing to the Java console. You can't step through the code as it executes and examine objects and variables as you like.

One of my colleagues, who codes a lot more Java than I do, says that this is not really a disadvantage. You just do your Java coding in an external development environment (Eclipse is recommended) and then move the code in to the Notes database when you have finished coding. When developing in an IDE like Eclipse, you will still be able to access the Lotus Notes objects such as the database, view and documents. When debugging, you are able to examine your objects and variables.

Depending on what you want to do with your agents, a disadvantage is that Java agents are restricted to the Domino back-end classes. No NotesJavaUIWorkspace is available.

How to decide
To me it's not a matter of choosing either Java or LotusScript for all my agent coding. I like to make my choice of language depending on what each agent is to do. Some agents are written in Java, and some are written in LotusScript.

Of course, other issues can have an impact on how you decide. If the organization wants to strengthen the Java skills of its technical staff, you might want to decide that most of your agents should be coded using Java.

Jens Bruntt has been a developer and infrastructure advisor for Notes and Domino projects since 1994 and is an R6 Principal Developer working as project manager or consultant depending on the project's size and requirements. Jens is working at Danish Convergens as a senior consultant, primarily architecting Domino browser-based Internet, intranet and extranet sites.


MEMBER FEEDBACK TO THIS TIP

What about the speed of Java execution vs. LotusScript? Which is faster? The biggest disadvantage of Java in general has been the lower execution speed. (Load any Java app on your PC and you can usually see the difference.) Perhaps LotusScript's overhead might make up the difference?

-- Joel B.

Do you have comments of your own? Let us know.


This was first published in April 2004

Dig deeper on Java for Lotus Notes Domino

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close