Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesVisual Programming for Lotus Notes


December 1994 / Reviews / Visual Programming for Lotus Notes

Notes ViP adds significant new features to Lotus Notes, including visual programming, reporting and charting tools, and enhanced connectivity

Rick Dobson

Without a doubt, Lotus Notes has become a huge player in the groupware market. The extensibility of Lotus Notes makes it much more than simple conferencing and information-sharing software. In fact, the word simple is rarely used in the same sentence with Lotus Notes. Complexity, especially development complexity, has long been a common complaint about Notes. The lack of strong reporting and charting tools has been another perceived weakness. Lotus Development has addressed these specific problems with the release of Lotus Notes ViP (Visual Programmer). Similar in design and ease of use to Microsoft's Visual Basic, Note s ViP is differentiated by several distinctive touches that promote ease of use, programmability, and Notes compatibility.

Notes ViP delivers some essential capabilities sorely lacking in Lotus Notes. It more fully integrates Notes with corporate data sources, including legacy databases. It provides a BASIC-compatible visual programming environment and visual linking tools to speed and simplify applications development. And it includes reporting and charting components that provide richer output.

Essential ViP

Applications built with Notes ViP integrate seamlessly with Notes, inheriting all of Notes's rich groupware functionality, including full-text searching, replication, remote access to data, encryption support, and mail-enablement. Notes ViP links to Notes databases through the Notes API. The Notes ViP data object permits the reading of Notes forms and views. Notes ViP applications can also update Notes databases. The same data object that links Notes ViP to Notes database objects also ties it to legacy relational databases, such as Oracle, IBM DB2, IBM AS/400, SQL Server, dBase, and Paradox. Notes ViP readily links and joins Notes databases with tables from these products and other databases and spreadsheets. Notes ViP interfaces with non-Notes databases through Datalens and ODBC (Open Database Connectivity) drivers.

Notes ViP includes the Toolbox--just like Visual Basic--so applications developers can draw objects on a form or application window. A unique Link Tool makes it an easy matter to assign any of 85 precoded behaviors to pairs of objects in an application window. The updated LotusScript version 2, a BASIC-like language that will become Lotus's standard scripting language, lets developers customize precoded behaviors, as well as create new behaviors without a prior model. LotusScript even empowers visual programmers to create their own custom object classes instead of creating them in C++.

The Link Tool is one of Notes ViP's most distinctive features. Tying two objec ts together can be as simple as choosing the Link Tool in the Toolbox and then drawing a line from a source to a destination object. The Link Tool automatically assigns a default behavior to the link between the two objects. If you prefer to have a different precoded behavior between the two objects, you can select one from a list. As you highlight different behaviors, the Description text changes and new LotusScript code shows in the Script text box.

For example, if you draw a link between a command button and a chart object, Notes ViP automatically selects DrawChart, its default behavior for the pair of objects. This precoded script redraws the chart whenever you click the button in the Run view.

If none of the precoded behaviors meet your requirements, you may be able to develop the needed code by slightly editing one of the standard links. You select the link, click the right mouse button, and choose Script Editor from the menu that appears. From here, you can edit the LotusScript code that controls the link's behavior.

The Link Tool offers benefits to both beginning and experienced applications developers. Novice developers will find it easy to automate applications by choosing precoded scripts from a list. Advanced developers will find the Link Tool a help in building rough prototypes during visits to clients.

Developing with LotusScript 2

LotusScript, which Lotus originally introduced with Improv, was extended with the release of Notes ViP. Lotus plans to further refine and enhance LotusScript as it becomes the common macro programming language for its SmartSuite in 1995 and beyond. In release 2 of LotusScript, Lotus adds new features that are not available with other visual programmers, such as Visual Basic.

One of the most innovative features in LotusScript is its ability to code custom classes and then create objects based on these class definitions. Other visual programmers reserve this functionality for C++ coders. Classes created with LotusScript function exactl y as those defined with C++.

Notes ViP allows you to define classes with the Class...End Class statement. Classes can contain data and subroutine members. You use Public and Private statements to declare data members. A Public declaration makes a data item available outside the class definition. Data members are private by default. You define subroutine members with Sub...End Sub statements.

Notes ViP developers use classes in applications by creating instances of them. These instances are called objects. Data members function like object properties. Sub members operate like object methods. Classes and objects are contained within the module in which you define them.

Use the DIM or SET statements in association with the NEW keyword to create objects from class definitions. After an application creates an object for a class, it can use the object, manipulate its properties, and perform tasks with its methods.

The LotusScript example (see the listing ``Building Notes ViP Objects'') d

Class Inheritance

Classes can inherit properties and methods from each other. Notes ViP calls the class inheriting properties and methods a derived class. Base classes serve as models for one or more other derived classes. Properties and methods in the derived classes can override definitions in their base classes. Add t he AS keyword to the CLASS line in the derived class definition to reference a base class.

The second LotusScript example (see the listing ``Class Inheritance'') overrides the CheckOverdue method in Customer with a new method defined in NewCustomer. Notice how the AS keyword references the Customer class (from the listing ``Building Notes ViP Objects'') when it starts the definition of NewCustomer. However, the Name, Address, and Balance properties carry over as is from Customer to NewCustomer.

Notes ViP creates objects from derived classes in the same way that it does from base classes. For example, when you use the DIM...AS NEW combination with the derived class name, properties and methods from the base class pass to the object as long as the derived class definition does not override them.

The listing ``Class Inheritance'' uses the Name and Balance properties from Customer when working with an object based on NewCustomer. The CheckOverdue method from NewCustomer will print one of two messages depending on the value of the Balance property. The code segment generates both messages by invoking the method with a value less than $25,000 and then a second time with a value greater than $25,000. The original CheckOverdue method in Customer would have printed the same message in both cases.

Notes Programming Alternatives

Although Notes ViP represents a powerful, full-featured way to develop graphical access to Notes databases and legacy databases, a growing number of alternatives include Lotus's own Notes ODBC driver. In addition, Lotus publishes the Notes API so third-party firms can develop other integration tools.

Edge Research (a Portsmouth, New Hampshire, company that was recently purchased by Lotus and is now a wholly owned subsidiary) offers a rich set of tools for linking to Notes databases via the Notes API. These include the HiTest API, htVisual, and htGlue. The HiTest API is a C-language API that radically simplifies use of the Notes API. The other two tools rely on t he HiTest API to provide access to Notes databases from Visual Basic, Visual Basic for Applications, and LotusScript. (Edge Research posted a free sample application on CompuServe that allows Excel 5 users to link to Notes databases. It is in the Lotus Communications forum under the name XLSAMP.ZIP.)

Among the most widely known alternatives to Notes ViP is VB/Link for Lotus Notes from Brainstorm Technologies (Cambridge, MA). VB/Link relies on Notes API calls for the most part, but it also has additional linking techniques. Release 1.0 offers a VBX (Visual Basic custom control) that lets Visual Basic programmers link to Notes databases and develops a results set query. You can also link the results set to Visual Basic 3 data dynasets. Release 2.0 of VB/Link adds two new controls for processing rich text fields and hierarchical views.

The Lotus ODBC driver for Notes is important, because nearly all the major database managers support ODBC linking to other databases. You just add the Notes driver, set up a data source, and then attach and import Notes views and forms from the database designated in the ODBC link.

Lotus's database manager, Approach 3, uses Notes API calls rather than the ODBC driver to connect to Notes databases. This provides a richer interface with Notes databases than is possible with the ODBC driver.

With solutions already available for accessing Notes data, developers may concentrate on OCXes (OLE custom controls) that will link to Lotus Notes. This strategy will give them a portable-component architecture and a mechanism for linking to both Lotus Notes and Microsoft Exchange, Microsoft's planned solution for group communication and information management.

A Leap Forward for Notes

Lotus offers a free run-time version of Notes ViP to all licensed Notes clients. The run-time version lets Notes clients run Notes ViP applications without letting them edit the applications.The only other way that you can run applications developed with Notes ViP is to purchase th e full developer's version. If you use this version, code can be distributed in a locked file with a .VIL file extension, instead of the standard NOTES VIP. Because you cannot edit locked files, developers need to preserve unlocked versions of locked applications for maintenance.

With the release of Lotus Notes ViP and other products that link to Notes, developers have exciting, new opportunities to enrich their applications. The gaps in the Lotus groupware strategy are now being filled by Lotus and by solutions coming from third parties. It is now a straightforward process to mix Notes data with that of other database managers, which represents real progress in the world of Notes development.


The Facts



Lotus Notes ViP                 $995
Run-time version is free to all Notes clients.
Lotus Development Corp.
400 Riverpark Dr.
Reading, MA 01864
(800) 346-1305


Building Notes ViP Objects



Code illustrating how to define classes with Lo
tusScript. The code also reveals how to create and use objects that put the class definition to work in an application. The CLASS...END statement defines the class. DIM or SET statements in association with the NEW keyword create objects from class definitions. After an application creates an object for a class, it can use the object, manipulate its properties, and perform tasks with its methods.

ts amount of balance for object X
PRINT B




Class Inheritance



Classes can inherit properties and methods from each other. The AS keyword on the CLASS line references the base class. Here, the AS keyword references the Customer class (from the listing ``Building Notes ViP Objects'') when it starts the definition of NewCustomer. The DIM...AS NEW combination passes the properties and methods from the base class through to the object as long as the derived class definition does not override them.

il a payment of:
X.CheckOverdue
PRINT X.Balance




Visual Programming for Notes



Lotus                     Microsoft                       Advantage
Tightest possible         Good integration                Lotus
integration with Notes    with Notes 


Link Tool                 No linking tool                 Lotus


Has Notes in              Does not have Notes-style       Lotus
product category          product yet; Microsoft
                          Exchange is
                          in development


No VBXes or OCXes;        Many VBXes; OCXes on the way    Microsoft
plan future support for   VBXes and OCXes


Developers must learn     Large pool of experienced       Microsoft
a variant of Visual       Visual Basic programmers
Basic


20 objects                Hundreds of objects from        Microsoft
                          Visual Basic, Visual Basic 
                          for Applications,
                          and
 Access Basic 


Single-company support    Requires support from           Lotus
                          more than one company


Must distribute           Can distribute .EXE files       Microsoft
run-time version          for rollouts 
for rollouts 


Custom class and          C++ required for                Lotus
object definition         class definitions 


Designer tools            No designer tools               Lotus


Illustration: Notes ViP's Link Tool automatically assigns a default behavior to the link between two objects. Drawing a link between a command button and a chart object generates the default behavior DrawChart. This precoded script redraws the chart whenever you click the button in the Run view. As you highlight different behaviors, the Description text changes and new LotusScript code shows in the Script text box.
Rick Dobson, Ph.D., is a consultant and writer who lives in Louisville, Kentucky. He has authored titles fo r Que Books on subjects that include macro programming and optimization techniques for Lotus 1-2-3, as well as numerous articles for the computer press. You can reach him on CompuServe at 71172,57 or on the Internet at 71172.57@compuserve.com .

Up to the Reviews section contentsGo to previous article: Peer into the FutureGo to next article: Speedy Data DeliverySearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network