Manage Learn to apply best practices and optimize your operations.

Andre Guirard on Java vs. LotusScript

We asked SearchDomino.com expert and IBM Lotus developer Andre Guirard which was better -- LotusScript or Java. His response -- "They're each better than the other one."

View member feedback to this tip.

Andre Guirard
Recently a developer asked the question, .mgn7axGcQYd.3@.ee7740b/16703!viewtype=threadDate&skip=&expand=>What are the advantages and disadvantages of writing a Java agent over a LotusScript agent? in the SearchDomino.com developer discussion forum. We asked SearchDomino.com expert and IBM Lotus developer Andre Guirard for his opinion on this matter. His response -- "They're each better than the other one."

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

Advantages of LotusScript:

  • I personally know LotusScript much better than I know Java.
  • It allows access to the Notes client "front end" if run from a Notes client.
  • There are lots of free Visual Basic examples that you can steal and reuse in your code.
  • There are lots of free useful LotusScript classes and functions that you can download from various sources and reuse. For example:

    • Codestore.net
    • Domino Design library examples
    • OLE automation using LotusScript is really easy, particularly when integrating with Microsoft programs that use Visual Basic as their internal scripting language. For instance, you can record a macro in Excel and then just copy and paste the resulting code into your LotusScript agent to automate the same task.
    • It lets you use the LC LSX for accessing relational data, which is generally more efficient than JDBC -- if you know the efficient way to write LC LSX code (see LC LSX chapter in Implementing IBM Lotus Enterprise Integrator 6).
    • It's less strict than Java, making it easier to write little throw-away scripts for one-time use. For example, you aren't forced to either handle or declare every possible error condition.

Advantages of Java:

  • Java is trendy, so in your resume or annual performance review, it sounds much better to say that you wrote lots of Java code than that you wrote lots of LotusScript.
  • Java supports multi-threading, allowing your script to do other things during an I/O wait or while waiting for a remote process to return.
  • There are a lot of other applications for which LotusScript is not an option and Java is, so you might as well get the practice.
  • If you later need to convert your agent into a servlet for better performance, you don't need to rewrite the entire thing.
  • There are a great many free, pre-built Java classes that you can steal and reuse. (Note, however, that you can also use most of these from LotusScript via LS2J).
  • HTTP operations are easier in Java. Using classes that come with the Java environment, you can easily do both "gets" and "posts" with any content type. LotusScript just lets you do "gets," and then the content had best be HTML. And then it's not easy to get the original HTML.
  • Java is more strict and formal than LotusScript, making it a good choice when you want to write bulletproof, easy-to-maintain code that will be around for a long time.

As part of the Enterprise Integration team at Lotus, Andre Guirard works on upcoming versions of LEI and the LC LSX. Andre has published several articles about Domino development (mostly in The View), is an occasional conference speaker and has coauthored the Domino Designer 6 Application Development Redbook.

MEMBER FEEDBACK TO THIS TIP

Java is far harder to debug than LotusScript is. Java Error messages are vague and useless.

-- Joe A.

***********************************************

That is not necessarily true. In LotusScript, you must have the debugger open in order to find the error. I find the LotusScript debugger a real pain after coming out of the Java environment. If you have any kind of Java console, you get the exact line the problem occurs on, the exact problem, and can easily adjust your code accordingly.

-- Jeff L.

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


Dig Deeper on Java for Lotus Notes Domino

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

SearchWindowsServer

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 ...

SearchDataCenter

SearchContentManagement

Close