Object Oriented Programming is the dominant style in modern program as used by popular languages such as Java and C#. Despite this, OOP is not widely used within LotusScript even though the language support many of the capabilities needed to implement OOP. The following is an introduction to the key components of LotusScript used to develop using OOP.

Classes

One of the key principals of Object Oriented Programming is the use of classes to encapuslate data objects.

Once defined, a class should facilitate all access to the object via properties and the manipulation of that object via methods.

Class Names

Class names must be unique across all LotusScript code that is references within a single module. This includes all "Use " statements and and "Use" statements contained in those LotusScripty libararies.

Class names are not case sensitive. e.g. having defined a class Employee it is not possible to craete a second class callled employee and it is possible to refer to the class using EMPLOYEE.

Constructor

Each class can have a constructor denoted by Sub New

When a class extends another class the constructors for each class are invoked starting with the based class and moving outwards.

Unlike some programming languages, the constructor cannot be overloaded with differing number of parameters or different Types for each paremater. One way around this limitation is to provide a single parameter to the constructor of type Variant and then add logic to the constructor that tests the Type of the parameter.