Inheritance and Polymorphism on LotusScript

| 2 Comments

Here is a derived class called MyClass2 that uses the base class MyClass1:
Class MyClass1 ' Base class.
a As Integer
Public c As Integer
'...
End Class

Class MyClass2 As MyClass1 ' Class derived from MyClass1.
b As Integer
Public d As Integer
'...
End Class
Dim x As New MyClass ' Object x has members
' a%, b%, c%, and d%.
x.c% = 12
x.d% = 35

Then, Polymorphism, in my eyes, LotusScript does not support polymorphism or overloading.

2 Comments

Thats right. Overloading only works with EXACTLY the same signature - which isnt nice. And classes can only inherit from one other class (unlike java which can inhert from another class, but add "interfaces").

Other things missing are stuff such as introspection - the ability of a class to interrogate its signature. You can get the name of the class using "TypeName(object)", but thats about it.

Recursion in Lotusscript is the last issue - it only supports a stack of around 170 or so calls deep, which makes recursion hard for anything but the trivial of applications.

It does have huge strenths - but in terms of complex OO systems, theses are the things that might want you to start investigating Java for newer systems.


---* Bill

Dear Bill,

Thx for your cimments.
Your presentation, DevBlast - 30 LotusScript Tips, in Lotusphere 2007 is beneficial to me.
Thank you so much!

March 2010

Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Archives

Powered by Movable Type 4.34-en

Recent Comments

  • philipz: Dear Bill, Thx for your cimments. Your presentation, DevBlast - read more
  • Wild Bill: Thats right. Overloading only works with EXACTLY the same signature read more

About this Entry

This page contains a single entry by philipz published on February 10, 2007 4:22 PM.

How to Handle Errors on LotusScript was the previous entry in this blog.

LotusScript傳值到IE is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.