February 10, 2007

Inheritance and Polymorphism on LotusScript

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.

Lotus Domino Object Oriented LotusScript

Trying to explain inheritance and polymorphism
Using the object-oriented features of LotusScript
Head First Object-Oriented Analysis and Design
Object Orientated Lotusscript Presentation
Object Orientated Programming in LotusScript (The View)
LS2007-AD507 - Leveraging the Power of Object Oriented Programming in LotusScript
LS2007-BP301- Advanced Object Oriented Programming for LotusScript

Posted by philipz at February 10, 2007 04:22 PM
歷史上的今天
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

Posted by Wild Bill at February 12, 2007 12:36 AM

Dear Bill,

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

Posted by philipz at February 12, 2007 05:54 PM
Post a comment













Remember personal info?