IBM®
Skip to main content
    Country/region select      Terms of use
 
 
   
     Home      Products      Services & solutions      Support & downloads      My account     
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Technical Library
developerWorks

Book Review: Programming Domino 4.6 with Java
by
Barbara
Burch

Iris Today Archives

Level: All
Works with: Domino 4.6
Updated: 04/01/1998

Inside this article:
Java programming

Into the future

Related links:
Looseleaf Software

The hidden power of Profile documents

Tips on debugging Java agents

Java Programmer's Guide


Get the PDF:

BKRVW.pdf(16Kb)

Get Acrobat Reader

    Programming Domino 4.6 with Java
    by Bob Balaban
    Published by M&T Books, an imprint of IDG Books
    Available online at Amazon.com and Barnes & Noble.

    Books about Java seem to be a dime a dozen these days. Books about Domino 4.6 are a little bit harder to find. And until recently, books that covered both topics were pretty much nonexistent. So, Bob Balaban's new book Programming Domino 4.6 with Java definitely fills a niche.

    And yet, the book does much more than merely fill a niche -- it's a down-to-earth introduction of how you can use the Java programming language to manipulate Domino objects. What's more, you get a unique, insider's look at why things work the way they do, because Balaban was one of the key developers behind it all. A 10-year veteran of Lotus and Iris, Balaban is the architect and developer of the Notes Object Interface (NOI) for both LotusScript and Java. He recently left Iris to form his own company, Looseleaf Software.

    In fact, you may already be familiar with Bob Balaban. He's written articles for our very own Iris Today and for The View, an independent technical journal on Notes and Domino. In addition, he's been a very active participant in the Lotus Business Partner community.

    The book puts all of Balaban's experience to good use, and is written in a clear style that is very easy to follow. In his own words, the book explains to "the gazillion people out there who work at developing killer collaborative / groupware / client-server / Internet / intranet applications why they should care about Lotus Domino, or Java, or both." It's both an introduction to Java for Domino/Notes application developers that are already familiar with LotusScript, and an introduction to the NOI for those programmers already familiar with Java. And if you don't fall into either of these groups, you'll still be able to learn a lot from the easy-to-understand descriptions of basic concepts.

    With that said, the key point is that the book covers introductory material very well. It's a great starting point for learning about the Java classes and related Domino/Notes concepts, and how to write Java applications, agents, and servlets for Domino. In particular, there's a detailed discussion of writing multithreaded Java programs for Domino. If, however, you're looking for advanced code samples, you may find the coverage of servlets, JavaBeans and JDBC slightly lacking. You can give your own feedback on the book in the Looseleaf Forum hosted on the company's Web site.

    The book includes a CD with all the examples and supporting Notes databases, along with Sun's Java Servlet Development kit and Lotus' LSX Toolkit. In addition, there's a pull-out, color poster of the Java NOI classes.

    An introduction to the Java classes
    Before diving into the Java classes, Balaban starts off with an overview of Domino/Notes programmability. Although he assumes familiarity with object-oriented programming concepts, he describes the Notes Object Interface (NOI) and the different kinds of programs you can write for Domino, in basic, straightforward terms. This sets up a framework for the rest of the book. We learn that the NOI is a set of classes used to manipulate the functionality of Notes workstations and Domino servers. And, that as of Domino 4.6, the NOI is available through LotusScript and Java bindings, as well as through OLE automation. We also find out the differences among Java, JavaScript, LotusScript and VBScript.

    The next few chapters are devoted to the nitty-gritty details of the Java NOI, including the properties and methods for each class, along with examples of how to use them. Except for the different syntax, the Java interface is very similar to the LotusScript one. In general, you can do anything with Java applications and agents that you can do with LotusScript agents, and Java provides functionality that's not yet available in LotusScript, such as multithreaded programming and high-level network object libraries.

    The class descriptions include nice explanations of associated Notes concepts. For example, the description for the Database.GetProfileDocument method includes an explanation of the benefits of Profile documents. (For more on Profile documents, see the Iris Today article "The hidden power of Profile documents.") The description of the Document class explains the difference between items and fields (an item's a data element, while a field's a design element). And, in the description of the View class, we learn how views in Domino/Notes are roughly equivalent to tables in relational databases.

    In addition, while anyone could give you a dictionary-like listing of the classes, we get an insider's look at why certain properties and methods are the way they are. For example, in the description for the RichTextItem method "appendDocLink," Balaban explains why there are no corresponding methods for adding links to views and databases -- namely "the developer, yours truly, screwed up a bit." We also learn the reasons why the EmbeddedObject class doesn't support OLE object activation in Java.

    Java programming: Multithreaded and more
    Then, we get to the actual Java programming. Chapter 7 walks us step-by-step through both a single-threaded and two multithreaded skeleton applications. This detailed information is great for the beginning Java programmer. We learn that multithreaded programming is one of the strong points of Java, and works particularly well when one or more tasks are subject to long delays waiting for network or disk I/O. Then, there's the Web crawler example, which is a popular example in the Java books nowadays. This one's unique in that you're creating a multithreaded Domino application that results in a hyperlinked subset of the Web in Notes database format. Balaban points out that the code could be optimized, and some readers may prefer that he had already done the optimization himself.

    Next, it's on to Java agents, including steps for how to create a Java agent, as well as a discussion of multithreaded Java agents. And, of course, an important part of writing agents is being able to debug them, so Chapter 9 discusses the current debugging options. Because Domino 4.6 does not include an integrated debugger for Java, Balaban explains an interim solution that you can use to debug your Java agents. Basically, he shows you how to create an agent that can be debugged as a standalone program, but which doesn't have to be rewritten to work as a "real" Domino agent. To get a preview of this debugging technique, see Balaban's article in Iris Today, "Tips on debugging Java agents."

    Chapter 10 gets back to multithreaded programs with a discussion of thread safety and sharing objects across threads. Except for a couple restrictions, we learn that the Java NOI classes are thread safe, and that the internal mechanisms by which they are thread safe are optimized for performance. This is a key chapter for anyone planning on implementing multithreaded programs. My favorite part is the summary with the recommended do's and don'ts to consider when designing a multithreaded program. It's like the seven "Golden Rules" of multithreaded programming.

    Then, we learn about servlets in Chapter 11 through standard Hello World examples. This is where Balaban lets his bias toward agents shine through, stressing the better security and convenience of agents over servlets. In fact, he includes code so that you can easily transform any servlet into a Domino agent. If you're partial to servlets and are looking for advanced examples of how to use them with Domino, you're out of luck.

    The next chapters describe how Domino relates to JavaBeans and Java Database Connectivity (JDBC), respectively. Both chapters are good as an introduction to the concepts, but advanced users may prefer meatier details. Basically, we learn that the development efforts around JavaBeans aren't really oriented toward Domino. The reason is that most JavaBeans development is applet-oriented and focused on the user interface, while the Java NOI is more oriented to server-based applications and agents. As for JDBC -- for connecting Domino/Notes to relational databases, we do see an example of how to use the functionality. But, again, the information didn't seem particularly advanced.

    Into the future
    Balaban wraps up the book by summarizing the Java advances in Domino 4.6, and by taking a look into the possibilities for the future. His main predictions for the future of Domino as it relates Java revolve around the need for:

    • A Java Integrated Development Environment (IDE)
    • Remote object access, including a Domino Object Request Broker (ORB) and NOI for ORB clients, and Remote Method Invocation (RMI)
    • Java classes for other standard protocols, including LDAP, IMAP, and so on.

    Of course, as the disclaimer states at the beginning of the chapter, Balaban's predictions are based on his own opinions and don't guarantee any specific product plans. His thoughts on the future are interesting, though.

    And, ending on a high note, the appendices contain some useful gems, including an extensive list of links and references, recommendations for development tools (only Microsoft's Visual J++ is definitely out), and a complete table of the NOI exception codes and messages.

    Summary
    Overall, I'd recommend this book as a great learning tool for anyone getting started with Domino and Java. Unlike the Java Programmer's Guide that ships with Domino 4.6, you'll learn more about the basic concepts behind the Java NOI classes. And, you'll learn how to start using them in everything from agents to servlets to multithreaded applications. When you're ready for more advanced topics, Balaban points you in the right direction with the list of useful links and references. The best part is that you get all this information packaged in a clear, informal writing style -- making this much more than a book that fills a niche.


What do you think of this article?

    About IBM Privacy Contact