benpoole.com

“It is a very sad thing that nowadays there is so little useless information.”

Old dog, new tricks

Without wishing to sound like an arrogant twonk (but I suppose I will), I found myself somewhat disgruntled recently when I heard I would be required to code a Notes database. “Gah! Not another one!” No-one wants to be a Monkey-Programmer-Boy after all. So, the thing had to be done, and life had to be made interesting. Here’s how I did it:

	Dim LA As New LinkedArray(Null)
	Dim i As Integer

	LA.add "Winkle"
	LA.add "Fe"
	LA.add "Fir"
	LA.add "Fo"
	LA.add "Fum"

	Msgbox LA.asString(" ")

	i = LA.getIndex("Fo")
	Msgbox "i is " & i

	LA.insert "Gah", 3
	LA.makeUnique
	Msgbox LA.asString(" ")

I’ll write more about my experiences should anyone find this useful, but in the meantime, please feel free to chip in with your ideas!

Posted at 12:36 GDT on 16 Apr 2004  |  Categories: See other weblog entries under the 'Notes and Domino' category  |   (10 comments)




Comments

  1. Ben,

    Re. your array class. Kanngard has also written a good "vector" class, amoungst other things.
    http://dev.kanngard.net/Permalinks/ID_20020506204851.html

    Nick

    on 16 Apr 2004 by nick (#)
  2. Ben, if you ain't doing MPB stuff (you lucky fish), what are you working on these days?
    on 16 Apr 2004 by Colin Pretorius (#)
  3. Mainly my coffee drinking skills [smiley smile]
    on 16 Apr 2004 by Ben Poole (#)
  4. i'm actually having a hard time lately writing lotusscript code that isn't OO. i've got the bug!

    like the sound of that class, give it up willya?

    ;-)
    on 16 Apr 2004 by jonvon (#)
  5. Ben: project management? :-P
    on 17 Apr 2004 by Colin Pretorius (#)
  6. I really like the sound of test based development. Particularly if it leaves me with a kind of jUnit kind of test harness for the Business Logic of the application. This would be just dandy for integration testing n'all. Trouble is that in most Domino applications you can't really use too much lotusscript beacuse the agent manager will kill you. I struggled with Kent Beck's book but there is some good stuff at www.testdriven.com
    on 17 Apr 2004 by Spug-Me-Not (#)
  7. Agreed Spug-meister, you don’t want loads of agents everywhere. But in the testing / dev cycle that’s OK.

    Colin, no, haven’t turned to the dark side smiley wink This was just the first “greenfield” Notes development I’ve done in ages. Most stuff for me now is tinkering, managing others and Java coding.
    on 17 Apr 2004 by Ben Poole (#)
  8. For a JUnit-like environment, check out LSUnit at:
    http://amano001.at.infoseek.co.jp/LSUnit/
    It needs to be run through Altavistas babelfish, but I successfully converted it to a R5 unit testing framework.

    - Johan
    on 19 Apr 2004 by Johan Känngård (#)
  9. I think I see a problem with the test - "Fir" should surely be "Fi".. [smiley smile]

    Seriously good fun, isnt it. Our iDM stuff is now about 120 classes, etc, etc. And this is the only way you can really deal with the stuff.

    As a rule of thumb, we generally end up writing as much test code as we do actual code.. Which isnt very good, but does mean that the unit testing works well.

    Mmm. A linkedArray class. nice. Especially if it reads and writes directly to and from document items..

    ---* Bill
    on 19 Apr 2004 by Wild Bill (#)
  10. Well-spotted Bill [9] smiley wink The LinkedArray is still being tinkered-with... a few more methods would be nice, then I might expose the soft-white underbelly of my code to wider scrutiny. It’s about time, haven’t posted anything useful in ages!

    Whenever I muck around with arrays I always fret about Redims and whether I should be using Lists.

    Johan [8], interesting link - however, if it’s LSUnit you’re after, check out Nik Shenoy’s site:

    http://members.rogers.com/nshenoy0424/code/downloads.html
    on 19 Apr 2004 by Ben Poole (#)










(HTML OK. Line breaks & links converted, so don’t use anchor refs)