PreviousNext…

Objects and procedures

Rocky Oliver has a great discussion about Lotusscript coding going on at his site. I must confess to doing very little objected-oriented programming in my Lotusscript, but that's usually because what I'm doing with it doesn't warrant it, and certainly isn't on the scale of complexity that Nathan describes in one of his comments.

It's also a royal pain in the arse in that IDE

So anyway, I tend to leave OOP aside, and stick to being procedural with my script. That said, if you do want to learn more about OOP in Lotusscript, I can thoroughly recommend Doug Tillman's article (found in the January / February 2003 issue of The VIEW) entitled Apply OO Analysis & Best Practices to Build a LotusScript Framework or Bruce Perry's LDD article, Using the object-oriented features of Lotusscript. Both are excellent introductions to getting your brain in gear for this sort of thing.

So, the whys and wherefores: what I think is important, regardless of whether one goes procedural or OOP in one's Lotusscript, is that the code is well-organised. Each method, sub or function should have a clear, well-defined purpose, with a nicely limited scope. As I mentioned in the post about globals a little while back, code works so much better, and is so much more maintenance-friendly when it's self-contained, modular, easy to re-use, and doesn't require the developer to fiddle with its innards (so to speak) once done. Ah, the holy grail…

Comments

  1. Thanks for the article links.Ben Langhinrichs#
  2. Thanks for the mention, Ben - and for the references. Good stuff!
    Rock#
  3. Wahey, that LDD article is the one that really got me going with OO development in LotusScript - I still name private variables in a class using the m_varname way that Bruce Perry suggested. Thanks for the link :-DColin Pretorius#
  4. Heh heh, that's cool. I wrote the marvellous "BensBetterNewsLetter" class after I read Bruce's article… and I still use it ;-) Ben Poole#
  5. Probably the first classes I wrote were oFileDumper and oFileReader. I've hardly had to use the (obscure) file handling syntax in LS for nearly 2 years… that's what I love about OO, you can abstract away all the confusing stuff *and* you come off looking really clever.

    People think you're being the ubercoder, but it's just because I'm too lazy to dig through the help db every second week. And you don't feel like a complete idiot around people who can rattle of arcane syntax in their sleep… "Well *I* have it wrapped in a class, y'know" :-)

    I'm beginning to think I missed out on a whole planet of fun by not calling the classes ColinsFunkomaticFileHandlers, though :-)Colin Pretorius#
  6. heheh… whole planet of fun… good one. :-)jonvon#
  7. Thanks a million for the OO links. The topic just doesn't get much coverage, and I need the help!Ergle#
  8. Object-oriented programming is a little harder in LotusScript because a lot of the convenience features are missing (such as method overloading or static methods). You can get around these issues, but it makes things a little more messy than newer languages.

    The comments about the IDE are also very true. I find TeamStudio's Analyzer does a pretty good job of breaking out classes in the Declarations section of a script library.

    I highly recommend Robert C. Martin's latest book, "Agile Software Development: Principles, Patterns and Practices". It turns out I've been pretending to program in an object-oriented way for a long time, but after reading this book I'm starting to understand what it's really all about.Nik Shenoy#

Comments on this post are now closed.

About

I’m a software architect / developer / general IT wrangler specialising in web, mobile web and middleware using things like node.js, Java, C#, PHP, HTML5 and more.

Best described as a simpleton, but kindly. You can read more here.

";