dynamic methods in lotusscript like the notesDocument class  
Use this IdeaSpace to post ideas about Domino Designer.

: -20
: 0
: 20
: Domino Designer
: lotusscript, oop, dynamic, method, expansion
: Alois Gruber1713 28 Jan 2008
: / Email
Just as NotesDocument supports dynamic Methods that give access to Items it would be a powerful extension to own classes in LotusScript. It might be implemented similar to the new/delete constructor/destructor as methods with specific names, parameters could be passed as variant array (or new Class called ScriptParameterCollection)
sub DynamicRead(methodname as string, param as Variant, returnvalue as any)
end sub
sub DynamicWrite(methodname as string, value as variant)
end sub
that way at another position in the code
myObject.Subject = "This is the new Subject"  would internally be resolved to
call myObject.DynamicWrite("Subject",variant array("This is the new Subject"))
This is  of course a source for typing errors like missing or changed characters, so it might be better to add a keyword to the class statement like dynamic that enforces the compiler to look for the two methods to be implemented.

1) Nick Radov1404 (28 Jan 2008)
While it would be helpful if LotusScript had a general mechanism for open classes and/or extension methods, I don't think this is the right way to do it.
The existing extended syntax for NotesDocument that allows direct access to items was a mistake anyway and should have never been added. It creates potential name conflict problems if IBM adds new methods or properties that conflict with the names of items in custom applications.
2) Alois Gruber1713 (28 Jan 2008)
I agree with you that it shouldn't have been added, but it is in there (and probably will stay there) and my experience shows, that it is used very frequently (because it saves characters to type) :-)
3) Axel Janssen6869 (28 Jan 2008)
Sorry, but this would be one of my worst maintenance nightmares.
Its adding "duck typing" to LotusScript. I find this concept has allready a high potential for confusion in JavaScript.
4) Starrow Pan5103 (16 Feb 2008)
Nick,you are right about the extended syntax.
5) Charles Robinson8913 (22 Feb 2008)
I don't care about saving anyone characters. I care about maintainable code. This isn't.
6) Kenneth Axi2537 (17 Aug 2011)
I totally agree with what everyone else said, especially @5 Charles: This type of coding can and will very often be a nightmare to maintain.


Welcome to IdeaJam

You can run IdeaJam™ in your company. It's easy to install, setup and customize. Your employees, partners and customers will immediately see results.

Use IdeaJam to:

  • Collect ideas from employees
  • Solicit feedback and suggestions from employees and customers
  • Run innovation contests and competitions
  • Validate concepts
  • Use the power of "crowd-sourcing" to rank ideas and allow the best ideas to rise to the top

IdeaJam™ works with:

  • IBM Connections
  • IBM Lotus Quickr
  • Blogs and Wikis
  • Websphere Portal
  • Microsoft Sharepoint
  • and other applications.

IdeaJam has an extensive set of widgets and API's that allow you to extend and integrate IdeaJam™ with other applications.

Learn more about IdeaJam >>

IdeaJam developed by

Elguji Software Logo