Expert Answer Center > Experts On Demand
EMAIL THIS
Experts on Demand
  EXPERTS ON DEMAND HOME     POSE A QUESTION     VIEW ANSWERS     BROWSE BY TOPIC        RSS FEEDS  
FEATURED TOPIC: Domino development
VIEW FEATURED TOPIC PAGE
Domino development
Blog Host:
Andre Guirard - product developer, IBM Lotus Software
READ ENTIRE BIO
Tit for tat
28 FEB 2005 19:42 EST (00:42, GMT)
The following blog entry consists of comments made by blog reader Mike B. and retorts from Andre. If you have a response to Andre's blog, don't be bashful. Andre may be able to take the time to respond to you, too.


Mike B.'s comments:

Magnifying glass, anyone?
Notes has to be one of the worst applications on the market from a UI perspective. Buttons cannot have keystrokes and so on. The list is endless. Don't get me wrong, I love the product, just a few tweaks could make it fantastic.

I have worked for four large corporations in South Africa and the U.K. that have migrated from Notes to Exchange, and the most common comment is how much easier Outlook is to use.

The superior user interface
Sort your start menu.

Teamwork
Unfortunately products like CIAO do not support a distributed development environment with occasionally connected developers (e.g., local replica, centralized log/config files). It would be a great product if it could work in a JIT-outsourced environment.

Object orientation
A half-hearted implementation, at best. Can ND7 and fix ND4/5/6 first! Oh, and let's not forget the bug called DGW -- please fix that before doing anything else.

Make it snappy
It would be nice to see some examples of the techniques working on a 1.5GB database with more than 500,000 documents. I think that would result in a re-think of some of the content of the Redbook.

The right tools
Again, products that don't quite make it. Analyzer cannot help you find all cases where a view is used across a 10-database application.

Error handling -- interesting stuff, but when your error handler needs an error handler, IMHO, you have gone too far.


Andre's response:

Notes has to be one of the worst applications on the market from a UI perspective. Buttons cannot have keystrokes and so on. The list is endless. Don't get me wrong, I love the product, just a few tweaks could make it fantastic.
We're tweaking like crazy over here! And fixing bugs too. If you'd like to send your endless list along to me privately, I'll pass on any I think are worthwhile (and that we don't already know about -- we do think about this stuff; honest!) to the appropriate folks. In some cases, I am the appropriate folks.


I have worked for four large corporations in South Africa and the U.K. that have migrated from Notes to Exchange, and the most common comment is how much easier Outlook is to use.
You can have the best of both worlds. Domino Access for Microsoft Outlook lets you use the Outlook client with the Domino mail server, so that you get the UI of Outlook plus the superior scalability, reliability, programmability (and so on) of Domino vs. Exchange. If you'd like to see your customers keep Domino in their accounts, please work with your local IBM sales contact. They know how to sell this solution.


Unfortunately products like CIAO do not support a distributed development environment with occasionally connected developers (e.g., local replica, centralized log/config files). It would be a great product if it could work in a JIT-outsourced environment.
It's hard to imagine how any system could work much better with Domino. We use Rational Clearcase internally for our product source code (we like the products so much we bought the company), but it's possible to create a reasonably automatic merge algorithm for text files. It would be much harder to do a sensible merge of two versions of a Notes design element. If you have some ideas, I'm sure Ives would like to hear from you -- it sounds like you've given the matter some thought.

Of course, occasionally connected developers can check things out while they're connected and work on them offline.

Actually, if I recall correctly, it's also possible to do a provisional checkout in CIAO, so you can work on something locally without checking it out from the server. But it's a bother to deal with the situation then if there is a conflict. That's the risk you take working offline; for some, getting to work from Starbucks is worth it. You might have to do something to set it up, like create a local replica of the checkout control database. Consult Ives.


Object orientation -- a half-hearted implementation, at best. Can ND7 and fix ND4/5/6 first!
A little late for that, but I'm part of the team that's working on UI enhancements for Designer, and you can be sure I'll do what I can to make it better. If you have specific suggestions, please send them along -- I'm making a little list, and comments from developers in the field can help me to extend and prioritize it. You understand we don't have a lot of people doing Domino development within the development group for the Notes/Domino product line. We mostly work in C++ and Java, and don't use the Designer client. People who use the Designer client from day to day have a different perspective on it than we do, and we need to hear from them.


Oh, and let's not forget the bug called DGW -- please fix that before doing anything else.
See what I said above about sending a list.


It would be nice to see some examples of the techniques working on a 1.5GB database with more than 500,000 documents. I think that would result in a re-think of some of the content of the Redbook.
I believe nearly everything that Redbook has to say is still true, even for large databases, but it's pretty old and probably is about due for an overhaul to take into account features that have been added since then. If you have some good ideas, let me know and I'll try to make sure they find their way into the next edition. I haven't done a lot of work with databases that large, but it sounds like you have, and I'm sure our other readers would appreciate any insights you could offer.

Notes/Domino is not a relational database, and databases with that many documents are at the very high end of what we envision the product being used for. The nsf file structure was not designed with that in mind. However, I think that you will be happy with the performance improvement if you try NSFDB2 in version 7. Or, in the meantime, LEI Virtual Documents give substantially better performance with very large data sets.


Again, products that don't quite make it. Analyzer cannot help you find all cases where a view is used across a 10-database application.
Actually, Analyzer is ideal for that, and I've used it many times on multidatabase applications. You just write all the analysis outputs for the whole project into a single output database, full-text index that, and Bob's your uncle.


Error handling -- interesting stuff, but when your error handler needs an error handler, IMHO, you have gone too far.
I'm not sure what you're referring to there... I didn't do that in my blog. I have done it, of course, when the situation called for it. If whatever you need to do to handle the error, itself might cause an error, then you need to deal with that situation -- regardless of what language you're using. This is part of the inherent complexity of software, not something specific to LotusScript. If the logical structure gets too sticky, you can write a subroutine and push the error handling off into there, so there's only one layer of error handling per routine. The syntax of C++ and Java makes a nested error handler more readable, of course. If you were suggesting we add try/catch to LotusScript, remember we have to deal with legacy LotusScript applications and the overall logical structure of Visual Basic (on which LotusScript is based and with which we would like to remain more or less compatible). But it's a thought.

Posted by Dana McCurley Tire-kicking deluxe
25 FEB 2005 14:11 EST (19:11, GMT)
This is the last day I'm scheduled to blog here, and I haven't really covered all the topics I wanted to. So I'm choosing from my list the one that I have the best story for. As I mentioned earlier, I have a slew of problem reports to deal with. It turned out that no fewer than eight of them were little easy problems with a single dialog. Two buttons, six fields, eight bug reports, all from the same person. We have at least one really thorough tester. This is fortunate for me, since having a lot of easy bugs to fix inflates my statistics, and I didn't design this dialog originally, so nobody's going to come to me to ask why all these bugs were there in the first place.

Software testing has certain advantages over testing physical objects (see the figure below), since the software is not typically destroyed in the process of testing -- at least not with most testers.

In a typical big-system development project, there are multiple phases of testing. If there's coding involved, the idea is to specify exactly how each piece of the code will work -- its interface with the outside world. In a RAD project, this often develops as you go along, but you mustn't skip the phase of documenting the final design. Then you "module test" each piece individually. This is easiest in an object-based design because the parts are designed to work independently (if not, you should review the design). This makes it reasonably simple to write module testing agents that exercise the methods and properties of a class to see whether they return the expected result or cause the expected effect. Module testing is something of an art, and for some types of objects, it's necessary to design them carefully in such a way that they can be tested. For instance, if a class is supposed to do call methods of another class to do mass updates to data maintained by that class, it's best to have a "play" version of the class that manages the data so that you can see that the right methods of that class are being called with the right arguments without having to actually update data. Dynamic loading of classes is helpful for this.

I've complained on previous days about the minimal testing most Notes applications get. If you want to do something a little more thorough than "tire kicking," I made a little list, a checklist for testing Notes/Domino applications. These are my ideas of what should be tested; if I've missed anything please reply to this blog and tell me what I left out.

Of course, manually testing every form and view is very tedious, which is why it so often doesn't get done. There are tools designed for the task of testing applications in Windows (and there are other tools for other operating systems). These put the program through its paces by simulating the keystrokes and mouse clicks a user might enter and seeing whether the result is as expected. Of course, the program can't be expected to know what needs to be tested and what results should be; you have to write a testing script specific to your application and update that script whenever you update the application. This is a lot of work, and not every application is worth it. But if you have thousands of users or plan to sell something as a product, it makes sense to do. These types of tools can also be used to do load testing, by simulating many users accessing the system simultaneously. These are high-end tools, and you can expect to pay some money for them. I'm not a user of them myself, but a couple have been recommended to me.

So, to wrap up: I have more topics I want to cover, and now I'm all fired up to write about them. I might blog elsewhere or write articles. Or, if TechTarget asks me nicely, I might consider a return engagement. Please write to suggest it to them if you'd like to see that happen!
Posted by Andre Guirard Magnifying glass, anyone?
24 FEB 2005 06:36 EST (11:36, GMT)
I'm doing today's blog in a tiny font as a real-life example of what it's like for a low-vision user -- such as just about anyone over the age of 50 -- to read the standard-sized fonts of most computer programs. To make it easier to read, see the View / Text Size menu in your browser. Unfortunately this is not an option in all programs!

Yesterday I wrote about usability for the general end user, whose only handicap might be a total lack of anything resembling a brain. Today, I want to draw your attention to this checklist of what you must do to make your Notes/Domino applications usable for the differently abled. Also, it's instructive to browse through the IBM accessibility center generally to read about accessibility in other contexts.

If you're developing for the Web, you should also see these guidelines for Web accessibility and Bobby, a tool to scan your Web pages for anything that might be an accessibility problem. IBM also provides a comprehensive set of Web accessibility guidelines with their IBM Web Accessibility checklist. It's important to pay attention to this stuff, if not because you want to include as many people as you can, then because they might sue you under the ADA or Section 508 or other applicable laws in your country. Ask AOL and the Sydney Olympic committee about that!

The disabilities that most affect one's ability to use a computer application are:

  • Blindness or poor vision may make it impossible to read small print or any print or to make sense of any graphics. Low-vision users can often be accommodated by giving them an option to make the text bigger. But for some users, the contents will have to make sense when read by a screen reader. I'm not going to repeat everything you can read about in the above links, but here are a few key concepts:

    • Any information presented by a graphic will also have to be available in text form, either as the ALT tag of the graphic or some other way.

    • If you use layers for positioning, they will have to be positioned within the underlying document in an order that makes sense when they are read off in that order. You can define a layer at the end of the document, then move it up to the top, but that's a bad idea.

    • Anyone who can't see to position their mouse pointer will have trouble clicking things, so there needs to be a keyboard alternative for all actions. Even for something as simple as filling in a Notes form, you can't count on the fact that you can tab from field to field to take care of this for you. Depending how the form is laid out, tabbing might skip some fields. Field-level event code may also present problems for tabbing by refusing to let the user leave until they fill in a value or popping them into some other field. You have to actually try a form to make sure users can tab through it forwards and backwards using Shift+Tab.

  • Inability to use a mouse for some other reason, such as paralysis, which also requires a keyboard-only option.

  • Inability to press keys quickly may make it hard for some users to respond in time to any prompts that have timeouts.

  • Cognitive deficits may give some users trouble understanding how to use your site, unless the choices are presented clearly and lists are kept short. Actually, as I mentioned last time, all users need this -- some just need it more than others.
Computer users who are deaf don't have a problem using most applications, but if your program uses an alert tone, you do need to at least have a user option to add a hard-to-miss visual indication.

If you want to limber up your accessible-design muscles, here are some educational exercises to give you an appreciation for the disabled experience:

  • Get a screen reader, such as the popular JAWS, which is available as a free trial or Windows-Eyes from GW Micro, which also provides a free copy. Use it to listen to some of your applications. It's a revelation.

  • Have a mouse-free day once a week (and try out your applications during it). This gives you a good chance to learn about the frustrations of keyboard-only users. It's also an excellent motivation for learning the keyboard shortcuts for commonly used functions, which are generally faster than the mouse anyway. Today is my mouse-free day, and I can tell you that some of the toolbar options in some of the programs from a certain company in Washington state are not easy to find in the menus! Hint: the F6 key and Alt+Tab will be very useful!

  • Use the notes.ini parameter DISPLAY_FONT_ADJUSTMENT to increase the size of all your fonts in Notes, and see just how badly this messes up the design of your forms. To a certain extent, it doesn't matter whether the screen looks messy -- people who use large fonts get used to that -- though it is classier if it adapts well. The key question is: Is everything still visible? Can you see it all by scrolling around, or are parts irretrievably amputated? OS-style fields with an absolute size specified in inches or centimeters are a prime culprit here, as are layers with absolute positioning and size.
I'll finish up with a tip, a button script you can use to adjust the Notes font size using the ini parameter:
Sub Click(Source As Button)
 Dim answer$, size As Double
requestsize:
 answer = Trim(Inputbox$ ( "Enlarge all text by how many point sizes?
(0 = normal size)", "Font Adjustment", "0")) If answer <> "" Then If Not Isnumeric(answer) Then Msgbox "Font adjustment must be a number.", 0, "Font Adjustment" Goto requestsize Else size = Cdbl(answer) If size <> Int(size) Or size < 0 Or size > 100 Then Msgbox "Font adjustment must be in the range 0 to 100.", 0,
"Font Adjustment" Goto requestsize End If End If If size = 0 Then answer = "" Else answer = Cstr(size) End If Dim ses As New notessession Call ses.SetEnvironmentVar("Display_font_adjustment", answer, True) End Sub
Note: Negative numbers in this ini parameter do not work for adjusting font sizes downwards, but you should be able to do this in the Windows display settings.
Posted by Andre Guirard The superior user interface
23 FEB 2005 10:59 EST (15:59, GMT)
The book The Design of Everyday Things by Donald Norman sports a cover illustration of a very wrong-headed teapot. The handle and the spout are on the same side, making it a challenge to pour out without making a mess and burning yourself.

Norman has a new book out, Emotional Design: Why We Love (Or Hate) Everyday Things, about an interesting finding of researchers who study the effects of design on usability. Apparently, a visually attractive design is more usable than an otherwise equivalent unattractive one.

Since I love to create graphics and logos and make colors match and generally waste time making things look nice that could better be spent coding, this is a welcome finding for me! Maybe that time hasn't been all wasted after all.

Norman is also, however, very sarcastic about designs that have nothing doing for them but their attractiveness. Matte-black appliances with a row of identical black buttons are a subject of his scorn. Of a post office which won a design award, he notes that although all that clear uncluttered glass of the entryway looks stunning, people get trapped in it because they can't tell whether to push or pull the doors, and on which side to push or pull. Four choices, only one correct.

So, besides the newly discovered attractiveness advantage, there are other principles one must consider. I'm not going to write about them in detail, because that's less fun than giving bad examples. But here's a nice description of the basic principles.

As is appropriate, my first example is something that I did myself -- but fortunately not to anybody else (until now when I am inflicting it on you). So with some embarrassment, I present my Windows Start menu. How fast can you find "NetSupport" on this list? I'm not much faster -- I haven't memorized everything by position.

This menu badly needs organizing. I manage to get along with it because there are only a dozen or so programs I use frequently, and I put them right up front and give them shortcuts besides. Shortcuts and "frequently used" lists are an important part of good design, but when people have to make a choice from a list they're not familiar with, the list had better be short. If I were rolling out lots of PCs identically configured, the programs list would be very short and would consist of categories you can drill down through to find what you want.

Of course, when it's something a person can type and not have to think about, like what state they live in, a long list is appropriate. I certainly wouldn't want to have to first select my region of the country so that I can have a list of just seven states to choose from instead of fifty. It's not worth the extra key clicks and the bother of thinking about it.

Which brings us to the next bad example. I came across an application recently where you click the action button, and it asks you whether you want to do the action, yes or no, and if you answer yes, opens a dialog where you can specify more precisely what you want to do. In this case the choice is clear -- the yes/no dialog adds no value, so get rid of it. If you clicked the action button by mistake, you can just cancel. The principle: Count clicks and try to reduce their number. Also keep in mind that switching between keyboard and mouse takes time, and that not everybody can use a mouse in any case.

I also see lots of applications that prompt users for information in a series of one-field dialogs, which do not allow them to back up. Remember The Wizard of Oz? Like witches, there are evils wizards and there are good wizards. This is an example of an evil wizard. It's understandable why people would do this, because they can just write the code to ask the questions with a series of prompts, and they don't have to design dialog windows. But it's really obnoxious for end users. Deserves punishment.

One thing I don't understand -- I have to remember to talk with someone about this -- is why the default selection for Notes radio buttons and checkbox fields is an inset border. The default should be no border. In most cases, all they do is clutter up the form with extra lines without making it any easier to use. Sometimes you have a bunch of these fields next to each other and you need some division between them -- but there are better ways to do even that. Such as designing the form so that the fields are not right next to each other or giving them different background colors or using a single thin line to divide them. Forms are easier to use if they have a clean, simple look. There can be decoration around the edges, but in the key parts of the form, you only want to see things that convey needed information.

I could go on like this for quite a while, but instead let me just point you to a bunch more bad examples.

If I didn't work for Lotus, I would also have some satiric comments about applications that give no help when you ask for help, or worse, give help that's not specific to your situation. For instance, if you didn't understand how to use a particular form and you pressed F1, would you want the program to come up with instructions on how to fill in forms, in general, or about that specific form? I suppose for the first three days that someone ever uses a computer, the generic help would be best. However, since most people's careers as computer users extend over much more than six days (my mother-in-law being a notable exception) this will be the right choice much less than half the time. But I do work for Lotus, so I won't bring that up.

Posted by Andre Guirard Teamwork
22 FEB 2005 06:47 EST (11:47, GMT)
I came across this bit of silliness recently. If you've never seen Leonard Nimoy singing about hobbits, you're in for a treat.

Now, of course, it was a big mistake for Leonard to allow himself to become involved in a big production song and dance number of any kind, much less about hobbits. It's clear that his friends and advisors completely failed in their responsibility to help him steer clear of error. Someone really should have taken him aside and said, "Look, Len." They should have said, "I know you want to prove you are not Spock, but believe me, this is not the way. Decades from now millions of people will watch this idiotic thing on the Internet, and it will eclipse all your serious acting work by sheer badness." Or maybe he was warned, but was stubborn or had already signed the contract. How the mighty have fallen.

It is in just this regard that it makes total sense to have developers review each other's work before it leaves their hands and goes to the testers. The human brain is a funny thing. Once it decides what's supposed to be there, it gets really difficult for it to see what's actually there. It's very difficult to review your own code, because your eyes skim over the parts that you're familiar with, which is to say all of it, and it all looks fine. When someone else looks at it, someone who doesn't know already how it's supposed to work, they see things you don't.

Code reviews also pay off big time. It might seem at the time that you're wasting people's time when they could be coding or fixing bugs, but get over it! Studies have shown that formal code reviews prevent so many problems down the line that they pay for themselves many times over. Read An ounce of goat is worth a pound of hero

I also advocate pair programming -- two people working together on the same task. Again, the justification in part is that one person will catch the other's errors or be able to think of a better way to do the task. But there are other reasons this makes sense:

  • In the course of working out how they're going to approach the task, the developers are forced to actually plan the design, at least somewhat. This helps them structure their thinking about the problem and articulate reasons for choices that might otherwise be made by default (i.e., based on whatever the developer happens to think of first).

  • It combines normal work with education, as each developer picks up techniques and obscure information from the other.

  • It's more fun. This is not just my opinion; it's scientific fact.
For more details about pair programming and other ways to advance the productivity of your development teams, please read Agile Software Development by Alistair Cockburn.

Effective team development also requires that the members of the team know fairly well what the other people are doing. This is in part so they know who to ask when they have a question, in part for cross training purposes and in part to prevent duplication of effort (writing the same function someone else already wrote because you don't know they did). Both the code reviews and the pair programming advance this goal.

Resolving conflicts
These words have a different meaning to a Domino development team than to other types of teams. Team Domino development has special challenges. Since the entire Domino design is a single file, traditional versioning and check-in control systems don't work. It's not acceptable for one developer to hog a whole .ntf or .nsf file -- several people might need to be working on different parts of the design simultaneously. And if they do so, they are very likely to overwrite one another's changes.

In an earlier day's blog entry, I mentioned a tool for dealing with this problem. CIAO from Ives Software both keeps past versions of anything checked in and prevents simultaneous editing by requiring developers to check out design elements before working on them (or as they start to). In practice, this tool can be a little cumbersome, but there's nothing better that I know of, and it's so much nicer than when you discover that the 300 lines of LotusScript code that you wrote and painstakingly tested a week ago were overwritten by someone else who happened to be working on that design element at the same time, and now you have to try to reconstruct them from memory.

Paying attention to the "Save conflict" warnings is not enough to prevent this if developers are working on different replicas. Changes made in a local replica may still overwrite or be overwritten by changes made on the server or in another local replica, with no conflict warning. CIAO takes care of this.

Note: CIAO has a client install and a server install. It will work without the server part, but installing the server part guarantees that nobody not using CIAO can edit the design, bypassing CIAO's controls.
If your management is too cheap to spring for decent tools, you can instead employ the locking feature that comes with Notes/Domino -- you just have to turn it on in the database properties and set a few options. This doesn't do version management, but it does prevent work from being inadvertently overwritten by others.

Then, like the Hobbit dance troupe in the video, you can coordinate your activities and keep from stepping on each others' toes.

The Dreaded Generic LSE Error
There's another issue that you're likely to come across even if you're working alone, but more so when you have a team. When you save LotusScript code that calls a script library, the LotusScript compiler creates code that's dependent on the specific version of the script library being used. If the script library is then edited, the LotusScript code that calls it might or might not work. This may cause various problems, most commonly the "Generic LSE Error" message, but occasionally other more subtle issues. If the problem doesn't happen when you debug, that's a pretty good sign that compile order is the problem.

The "Tools/Recompile All LotusScript" menu item in Designer 6 is the easiest way to solve the problem. However, it's kind of a sledgehammer approach since it recompiles all LotusScript, even the bits that didn't need recompiling. Especially difficult if the database uses design locking or CIAO, since for any person to use this function, everybody else has to check in their work first. Getting hold of everyone to make them do this may be a challenge.

It would be nice to have a more selective tool, which would recompile only those parts of the code that actually need compiling. I don't know of one, but perhaps someone could post a link to help out the rest of us? It wouldn't be that hard to code if it doesn't already exist. If someone has time on their hands.

Then, like the Hobbits, we could all be happy and concentrate on important things, like eating. Which reminds me -- it's breakfast time! So long until tomorrow.
Posted by Andre Guirard Use it again
21 FEB 2005 12:50 EST (17:50, GMT)
You can go to the supermarket and buy a box of 300 drinking cups at a price that's low enough that you can afford to use them once and throw them away. I'm not a big fan of that myself, since I'd rather save a tree (or, if they're plastic cups, a dinosaur). But economically speaking, it's not an obvious wrong move – if you're having a big party, the storage space you would need to devote to storing 40 reusable cups, and the extra cleanup time, might well be worth more to you than the small extra cost of disposable cups.

We recently had a sauna built in our basement. Well, technically, because of door height requirements in the city building code, what we have is not a sauna but a highly improved crawlspace. However, for the purposes of this discussion, I will just say "sauna." We've been keeping count of how many times we've used it, and then we divide that by the price we paid for it, to determine the cost per sauna session to date. I believe it currently works out to about $450. I don't suppose anyone makes a disposable, one-use sauna, since only Bill Gates could afford them. But if they did, it would have to cost more than $450, so we're already ahead of the game – and each time we use our sauna, the price per use goes down.

When considering whether to buy a single-use or reusable sauna, the choice is pretty much a no-brainer. That's why I marvel that so many IT organizations seem to make little effort to design Notes applications in such a way that parts of them can be reused. The cost of developing a piece of software is much closer to the price of a sauna than to the price of a cup. And yet, many developers end up doing the same work that others have done before them, simply because there's no system in place to support reuse.

There are four main reasons why reuse efforts fail.

  1. Developers might not know that the work has been done before and/or where to find it.
  2. It might not have been done in a way that allows for easy reuse.
  3. Most developers might not care because they get paid for the time they work, not based on how effectively they use that time.
  4. Unlike a sauna, reusable code doesn't have that nice cedar smell.
There's probably not much we can do about that last point, but the others can be addressed.

In an earlier blog, I showed where to find reusable code. I also gave a link to a Notes database that lets you build up a library of reusable code and design elements that a team of developers can use. There are probably some other designs like this, but I know about this one because I wrote it. If you're ambitious, you could set this database up and send around a link to developers in your organization that it's there, and to please use it and contribute to it. If you're extra ambitious, you could go through the code samples in those other places I wrote about and create documents in the code library with a brief description and a link to any entries you think are particularly likely to be useful.

There are a couple of other such repositories specific to particular types of data:

Giving people incentive to use and contribute to a store of reusable objects is another factor you might work on. Any code or reusable object posted in the library and actually reused by someone has proven its value. The person who contributed that code is making your development organization more effective. As such, he or she should really be rewarded somehow. I also favor rewarding the people who searched for and reused the code -- they didn't have to, and having done so, they're not forced to report it.

You might not be in a position to institute a program of financial rewards, though if you do have any influence that would be nice. But rewards can come in many forms; people respond well to simple recognition, for instance. A monthly contest to see who has contributed the most reusable stuff and who has managed to reuse the most, with winners announced in team meetings, would probably be incentive enough for most people. Even just posting the stats where people can see them will help. It's a well-known principle of management that what you measure, improves.

The design element library database would probably benefit from some changes in its design to keep track of use. In particular, there ought to be a function to allow someone to record their use of something from the library, so that accounting views could be created to report the totals by element, developer and application where used. This information is also handy if you find a bug in one of these pieces of code, since you know which applications need to be updated.

Of course, the best reusability in the Notes world is where someone can take a whole application, create a new copy from the template and reuse it with few or no design changes. The whole team who worked on it should be recognized for that. This is actually a little easier to track, since you can scan a server to see how many instances of a particular design are on it -- provided you have some standard way of identifying a design that doesn't still have the template name in it. More about that another day.

It takes substantially more effort to write reusable code, compared to code that is suitable for a particular application. It's easy to see this if you browse the tips on SearchDomino.com, for instance. These are full of little functions that work for 30-80% of the cases you might encounter. For instance, see my comments at the end of A better way to track field changes. The author probably developed it for use on one particular form, it worked great with the data in their one form and that was all they needed. You can reuse this as is, but only if your form meets certain requirements -- no multivalued fields, for instance. Much better to have something carefully designed to meet all or nearly all conceivable circumstances, not just those of the particular project it was developed for.

This brings us to the Big Topic for today, which is how to go about doing Domino designs that can be reused.

Object orientation
First and most important, consider using an object-oriented approach for any code on the project. There are many excellent references about this, mostly not specific to Notes/Domino. An exception is Practical LotusScript, which I mentioned previously.

A well-designed class is easy to reuse and easy to extend. Of course, not every class is well designed; you still need to think about what you're doing. But the class syntax makes it easier to implement a modular design, should you design it in such a way.

For many Notes/Domino designs, the types of classes you might create relate to a particular type of document. Rather than having every piece of code know the specific fields on the document and their relationship to each other, you can design a class that presents the simplest possible interface to the outside world, by which I mean the other code that calls it. If you redesign the form, rename fields, change validation rules or what have you, you don't have to find every piece of code that refers to fields on that form and consider whether it's still correct. You just have to make sure that the one class is correct, keeping the programming interface to that class the same if you possibly can. The goal is to hide the details from the calling code; this limits the amount of code where the details matter.

Of course, a class that controls access to a particular type of document is not likely to be reusable in other projects unless they happen to have that same type of document. But there are cases where this can happen, particularly when integrating different applications.

Other resources specific to object orientation in Domino:

Modularization
One thing I really hate to see is a subroutine 300 lines long. With very few exceptions, this means that the developer has failed to consider which parts of the task can be broken out and coded as smaller reusable pieces. This is also a headache for maintenance, since nobody can keep all this in their heads at once. Practical LotusScript discusses this also, as does the invaluable reference The Elements of Programming Style, which without reservation I recommend to anyone who's going to write any kind of code. This book presents general principles that apply to all languages (with some items specific to FORTRAN), but predates object-based coding. Various more recent volumes focus on particular languages, since every language has its quirks.

Parameterization
This is covered in the above references also, but one key factor in writing a reusable anything is that the code should avoid referring to things by specific names that may need to be different in different contexts. Say you want LotusScript code to process all the documents of a particular form in a database and change the "server hint" from server A to server B in all the doclinks in one or more particular Rich Text fields. When the problem is expressed in those terms, you are almost forced to write some fairly reusable code. Because I haven't said which database, which Rich Text field or what servers server A and B are, it seems fairly natural to write a function that takes as arguments a Rich Text field and two server names and updates the server hints from the old name to the new name. That function by itself may be useful in other contexts (for instance, you might also want to update server hints in a document as someone is saving it) if they created a link to a local replica you want to redirect the link to a particular server.

If you had written the link updating code as part of a single large "Initialize" sub that included the hard-coded names of the fields and servers, it would be more work than it's worth to extract out the part that updates the doclinks. You might look at the old code to see what classes and methods you need to use, but the old code is a sample rather than a reusable element.

So far I've only been talking about code, but Domino designs can also be parameterized in a larger sense. Profile documents and other configuration documents let you define e-mail addresses of people to notify, keyword lists and whatever other factors you can come up with, so that they can be changed by someone who knows nothing about Domino development and who doesn't have a Designer client or high enough access to the database that their ignorance makes them dangerous.

Not only does this type of design make an application easier to maintain, but it also makes it much more likely that the entire design can be copied and reused for another purpose with no design changes -- again, the Holy Grail of Domino design.

Thinking ahead
A big part of making something reusable is just taking some time to think ahead about how people might want to reuse it. As we did with the doclink updating example in the previous section, try to put the problem in generic terms. Think about ways in which your situation is special, and consider ways in which the code could be written so that it will still work if your special situation no longer applies.

For instance, the doclink updating agent in the previous example is designed to be run in the case where we are replacing a server with another server that has a different name. The new server will contain all the same databases, so we're just assuming that by changing nothing but the server name, the link will still be valid. This is not necessarily the case in other situations where we might want to use this code. If nothing else, it makes sense to add functionality to test the updated link's validity, which the caller could optionally enable if they needed it. If the new link were not valid, the code could throw an error to the caller or otherwise indicate failure, allowing the caller to react in whatever way they see fit. Or, to go even further, the code could include functionality to have a list of possible replacement servers to search for a database containing the linked document. Then a single destination server just becomes the special case -- a list of one server instead of several -- and you're well on your way to developing a reusable doclink-fixing utility. Make it a class with internal data elements to keep track of which server it found a particular database on, so that it only has to search once for any given database, and now you're cooking with gas! But it's not the sort of thing you would have thought to do if you were wholly focused on the specific task.

Code/design reviews
Besides their role in assuring quality, about which more on a later day, code and design reviews are a great way to identify opportunities for code reuse and for identifying parts of a project that should be designed for reuse. The members of the review team might well be familiar with existing tools that the developer is not, and the mission of the review team is different, but the developer's task is to find a way to do it. The review team has a different role: to make sure that it's being done in the best possible way.

Get management buy-in
There's no getting around the fact that a reusable design costs more in initial development time than just slapping together something that works. The payoff comes in the later reuse -- the greater corporate ability to produce complex systems in a short time and the better ability to maintain the applications down the road. It's that sauna tradeoff: Do I get something cheap that leaks and that I can use only a few times or invest in something that'll last?

If managers don't understand the nature of this tradeoff, they must be made to understand. It helps to have a room that locks from the outside, where you can keep them until they agree.
Posted by Andre Guirard Make it snappy
18 FEB 2005 12:07 EST (17:07, GMT)
This is going to be a short entry because I have a backlog of bug reports, and I occasionally have to do some work to justify the exorbitant salary IBM pays me. Anyway, it's a popular topic, which is less work for me because lots of other people have written about it, so I can just tell you what to read.

The best references I've come across for writing Domino applications that execute efficiently are these:

(Thanks to Julian Robicheaux for a couple of these links!)

There's one technique that I haven't been able to find described well. Anytime you have a keyword field that uses @DbColumn or @DbLookup to get a list of choices, unless you're using keyword synonyms, it's a waste of time to look them up when opening a document in read mode. The standard formula for this is in ND6 and later is:

@If(@IsDocBeingEdited; @IfError(@DbColumn(...); "Error: " +
$Error); @Unavailable)
Julian gives a tip in the above links that discusses creating a separate Computed or Computed for Display field for this purpose, with a formula that allows it to only compute when the document is being loaded in edit mode. That's also a good technique to know, but it involves some tradeoffs. Since such formulas don't automatically recalculate when a document is put into edit mode; you have to either code a Refresh operation as part of the mode change, or accept that your data may be out of date if the list of choices has changed since the document was last edited. On the other hand, if you do have it in a separate field, the list is available to be used in multiple places. The above formula has the advantage of simplicity and gives best performance if you do need the value just in one place. If you previously returned @Unavailable for a keyword formula -- note: not "" -- then when you edit that field, the Notes client will try calculating the formula again because it needs that list of choices. As a result, you only have to spend time calculating the keywords for fields the user actually edits, and the delay is spread out so it's not so noticeable -- it's not fifteen seconds added to opening the document, but a second here and a second there. And if you use caching intelligently, only the first time each field is edited during a session.

Another good way to speed up forms that do keyword lookups, especially if your keyword list changes infrequently, is by use of a shared profile document. Write an agent to execute nightly (or at whatever interval seems best), do all your @DbColumns just once and store the results in the profile. Since the Notes client and Domino Web server both cache all the profile document fields, access to them is a lot faster than a live @DbColumn -- though the data might not be as up to the minute.

Please write in with any other performance tips you can add to what's given in the above materials.

And now, back to work. Look for another exciting episode on Monday.
Posted by Andre Guirard Common errors
17 FEB 2005 05:18 EST (10:18, GMT)
My editor thinks my blogs are funny. My wife theorizes that this is because my comments on rabbits have driven her to take Valium.

It's good to have someone to keep you humble.

I have found that no matter how many times I may speak at conferences or how many people may come to me for advice, to my wife I am still the man who failed to clean out the gutter drains, resulting in basement puddles.

(Rebecca, who has demanded approval rights on all my blogs to make sure a balanced view is being presented, points out that I'm also the man who gave her a big bunch of red roses on Valentine's day.)
Now we have that new kind of gutter with the hoods on top, that will supposedly never clog up. Plus it has the side benefit of annoying squirrels. So I don't have to worry about making that mistake again. This leaves me freer to focus on errors made by others.

So, today I'm writing about the most common deficiencies in Notes/Domino application designs. Here's a list of the problems I've seen most often in production.

General

  • Performance problems that don't show up in testing because you tested with 12 sample documents and the production database has 200,000 documents.

  • Dates or numbers are stored in text form, causing problems in calculations, view sorting or differences when users with different formatting options use the app.
Forms
  • No window title formula.

  • No input translation formula. Just as nearly every vegetarian recipe can be greatly improved by the addition of a little meat, there are few text fields that don't benefit from this formula:
    @Trim(@ReplaceSubstring(@ThisValue; @Char(9):@Newline; " "))
    
    And yes, you do have to worry about tabs in a field because they can be pasted in.

  • Field lacks help text, an accessibility issue.

  • F1 key displays the default help about how to edit a form, instead of detailed help about that particular form.

  • Keyword formula with @Db function fails to test @IsDocBeingEdited. (see Performance considerations for Domino applications, pg. 59)

  • Single-valued keyword field allows entry of new value, with no input translation to remove multivalue delimiters from value.

  • Fields are copied in rows of a table, and the designer forgets to update the input translation and validation formulas in all the rows. Then it's too boring to put different data in all 20 rows for testing, so you never notice that the data in rows 16-20 transforms itself into a copy of row 15. This is a good reason to use @ThisValue and @ThisName in the first place.

  • Input validations do not test @IsDocBeingSaved, resulting in validation error messages every time the form is refreshed.

  • Input validations are absent where they are needed (e.g., to make sure that a due date is in the future), or not sensitive to context (e.g., to make sure the due date is in the future) when the document is composed.

  • Hide attributes on Rich Text fields. The basic problem is that each paragraph of Rich Text has its own hide properties, which override those on the form.

  • The form is mailed or stored with the document -- usually unnecessary and a waste of space. Instead, use RenderToRTItem or send a doclink.

  • Form contains a lot of "Computed" fields that should be "Computed for Display." It's a pure waste of time and space to store two exact copies of the same field in a document.

  • Form contains two keyword fields; the list of choices for the second depends on the value for the first, and there's nothing to make sure that the values entered are compatible. (See this post to the Notes/Domino 6 Forum).

  • Form fails to adapt to different window sizes.
Views
  • View selection formula selects some main documents and all responses. For example:
    SELECT (Form = "Request" & Status = "Complete") | @IsResponseDoc
    
    The problem is that the view includes responses whose main documents aren't shown. If it's a hierarchical view, they are not visible, but take up room in the view index anyway. When you use full-text search in this view, the hidden documents can be found, which is probably not the designer's intention. Use @AllDescendants or @AllResponses instead (but read the help file about the database option you must enable to do this).

  • View access control lists used as security. More about this another day.

  • F1 key displays default help screen.

  • Last view column doesn't extend to window width. Provided it's left-aligned, there's typically no reason it shouldn't grow to fit, and there's plenty of reason you shouldn't just make it as wide as will fit on your screen when others' screens might be smaller.
LotusScript
  • Omitting Option Declare in LotusScript code. There's an option in ND6 to have it inserted automatically, so there's really no excuse. Of course, as Brian Mahoney eloquently points out, tools are no substitute for thinking, but why make more mistakes than you have to?

  • GetNthDocument method to iterate through a large collection. In most cases, this is slow. Use GetFirstDocument, GetNextDocument.

  • LotusScript errors are not handled.

  • There are few or no comments in the code.
Formulas
  • There are few or no comments in the code.

  • @Db function has no error handling.

  • Formula code in action button assumes the user doesn't know how to open and close Notes windows. For instance, it uses @Command([FileCloseWindow]) three times because the developer believes this will close the current document, the other document from which this one was composed and finally the view that document was opened from. This neglects the possibility that the user has opened, closed or switched to other windows meanwhile or opened the original document from a doclink.

  • Formula does the exact same lookup twice, both times with NoCache. The first time to check for errors, the second time to get the data. Use @IfError or store the lookup result in a temporary variable instead.
No doubt I've missed two of the biggest three, so please reply with anything important you see missing. The idea here is to list errors that are most common in production because their effects are subtle enough that they aren't immediately noticed. If you have an error that prevents you from composing a particular form at all, it's annoying and perhaps perplexing to track down, but it's not a quality issue because it's unlikely to get into production.

Now, I have to admit that I'm guilty of a lot of these errors myself. After all, Domino Designer is a rapid prototyping tool. It's a total waste of time to make the perfect input translation formula in a field before you're sure the field is even going to be in the final application. The problem comes about when you don't come back and finish that boring detail work before you call the application done; it's really easy to miss something when you're putting on that final polish.

Fortunately, most of these problems can be caught by an automated checker, such as the TeamStudio Auditor I described yesterday. It also helps to have a really good testing procedure (another thing I plan to cover in a future meandering diatribe). Of course, it's less expensive and time-consuming -- as well as better for your reputation -- to fix these errors before they get to the testing group and get written up formally. But, should some little error slip by you, just remember the magic words:

"I did that on purpose to see whether you were paying attention."

It doesn't work with my wife, but your QE department may be more gullible.

Off on a tangent: There's a custom among makers of handmade Turkish rugs to deliberately include an imperfection in the rug's pattern; the theory being that since only Allah is perfect, and it would be presumptuous of them to make a rug with no errors in it. In my mind, this gives rise to two questions. First, if they did it on purpose, how can they call it an error; and second, is it not more prideful to take pains to avoid perfection, since that implies that you could have done it perfectly if you chose? Doesn't it show greater humility to just do the best job you can, and assume it's not going to be perfect?

Call me a cynic, but I think that custom arose not for the greater glory of Allah, but so that rug merchants would have something to tell people who tried to bargain the price down by finding a flaw.

Like many things I write here, it's just a theory I have…

P.S.: I forgot to give credit last time to Christopher Byrne and Rocky Oliver for links they pointed me to. Thanks, guys!
Posted by Andre Guirard The right tools
16 FEB 2005 06:26 EST (11:26, GMT)
It seems that after yesterday's blog, I am in some hot water with my editor, Dana McCurley, who keeps bunnies as pets. She must not be a gardener. She also provides the correction that rabbits are not rodents (though they used to be considered part of the same family). To be technically correct, I should have said that they are very similar to rodents, the main difference being that rabbits, or lagomorphs as their friends call them, have an extra pair of giant incisors, the better to gnaw things with. In my view, this does not improve their character vs. Rodentia, since the less gnawing they do in my garden, the better.

To keep rabbits and other gnawers away from your tender young plants, you need certain tools.

  • Way more wire cloth than you might think is necessary.
  • Live traps to set where they have tunneled under the fence.
  • A bell to alert you when the trap is tripped, in the unlikely event you've managed to catch something. (Don't leave them in the trap for long, since they can harm themselves trying to chew their way out.)
  • Armored gauntlets to handle the animal with, should that become necessary.
  • A camera to take mugshots with, before you give the critter a stern lecture and release it far away.
To do Domino development efficiently and with fewer errors, you need tools, too -- besides Domino Designer. Here's a list of a few that I've found most useful or heard about from others.

Ives TeamStudio for Notes
I've been a fan of these tools for years, and they keep adding new ones. This is a suite of several utilities that install as Notes toolbar icons (or if you're still in the dark ages of R5, smart icons).

  • Analyzer creates a Notes database that describes the design of another Notes database. Each document in the output database describes one design element or sub-element (e.g., there's a separate document to describe each field on a form). The Notes/Designer client also includes a function to create a database synopsis, but this is better, because of the following reasons.

    • It works on large databases (unlike Design Synopsis, which tells you "too many paragraphs" if the design is too large).
    • It includes all the options and properties (or nearly all of them).
    • You can full-text index the database to search for names.
    • You can document design elements by writing in a Rich Text field on the documents; this is handy for the too-often-skipped documentation phase of a RAD project.
    • You can create views of design elements that fail to meet standards (text fields without help text or without input translation formulas, for instance). Then use these as to-do lists of things to fix.

  • Auditor runs in conjunction with Analyzer. It applies a set of user-configurable search filters to each design element description. Those documents that match the filter are flagged with a message that you define along with the rule (e.g., "Shared view formula must not use @UserName"). The filtering rule syntax is limited, but it's good enough to automate nearly all the things you might want to test for. Many filter rules come with the product, and Ives sells additional ones, which I haven't seen. (If they ship me a free copy, I could have a look at it and post here whether I think it's worth it -- in case anyone from Ives is reading this.) I also wrote a set of filters for them to distribute free on their Web site. You must register on the site to download it.

  • Configurator is a search-and-replace tool for Domino designs. Ives says this is handy for reconfiguring databases by changing a hardcoded replica ID or database path or Notes userID that may occur in the design, hence the name. In my opinion, it's better not to have hardcoded information such as this in your design, but that's material for another day's blogging. I use the search function much more often than the replace function. It's extremely valuable for tracking down precisely where in a hierarchy of 50 script libraries some global variable is defined or some field is referred to.

  • Delta is a comparison function for Notes databases. You can either have a report of the differences written into a Notes output database or see them live on the screen, drilling down to the ones you're interested in.

    The one big flaw I've found with Delta is that it shows you all the differences, even extremely trivial ones. There's a so-called "smart filter" that eliminates a lot of the differences that don't matter, but it's still time-consuming when comparing two versions of a form to have to drill down to the bottom of a long list of nested tables just to find out that the width of a table cell has been changed by .003 inches -- not because someone deliberately changed it, but because they had their actions pane open when they saved the form, and the table is set to fit to margins. It needs an option to show only functional differences between design elements and ignore all text formatting, table sizing and so on.

  • CIAO (Check In And Out) is a locking and version control mechanism for Domino designs. While locking has been addressed by ND6, the ability to record check-in comments and retrieve back versions of design elements is very valuable, especially on team projects. You can also invoke the "delta" tool on two versions of a design element to see what's changed between them, which has saved my sanity on more than one occasion.

There are other tools in the suite, but I find I don't use them so much. That might be due to my personal working style -- you might find them helpful.

The tool is far from free, but keep in mind, too, that developers' time is worth something. If you can use these tools to shave off a week here or a week there from a development project, you've more than repaid the investment.

NotesPeek
This tool lets you peek into the internal structure of a .nsf file. Not only can you see every note (at least those you have access to), but there's lots of technical detail about each note. This is just about the only way to tell how many deletion stubs are in the database, which is helpful for debugging replication problems. It's also a good way to learn more about how Domino databases are organized, which can help you figure out what's going to work and what's going to be efficient in your apps.

TopStyle
This CSS (cascading style sheet) editor is a tool for Web developers, but many Domino developers are also Web developers, and the Notes client implements CSS also (albeit less than completely). It pays to have a top-notch editor for CSS.

Which CSS editor is best is a religious issue. I freely admit that my opinion is totally subjective. Find one that you like, and it'll save you time.

Some kind of HTML editor
Since Domino Web apps often use passthru HTML, a tool to create it for you from a word-processor-like interface; it is a big timesaver. With version 6, the Notes client is also capable of rendering most HTML tags, which makes HTML useful when designing Notes client apps also.

For our purposes, a free or "comes with" HTML editor such as Microsoft Frontpage, is probably adequate. I am fortunate that my wife is a freelance Web site designer and we both work from home, so I have gotten spoiled -- when I want to create some HTML I ask her to go make us some tea or something and shift over to her computer for a few minutes, so I can use her copy of Dreamweaver MX 2004. I've been afraid to ask how much it cost us, but it's really nice.

A clip art collection on CD
For your control icons and decorations on your pages, you can get a lot of nice little GIF and JPEG files with an image search on Google. The problem with this is:

  • They're usually not the exact size you need, and bitmap images don't scale very well unless they start out a lot larger than you need them.
  • They're usually not free from copyright.
  • It's hard to find all the images you need for a single app in a consistent style.

If someone can post a pointer to a clip art collection that has a lot of useful images on it -- not cartoon people with huge oval noses or anything that a three-year-old could have drawn -- that would be s-o-o-o terrific. It should be vector graphics -- not bitmaps of any kind, so that they can be resized without losing detail -- and should include lots of different pictures with many in a realistic style.

A vector graphics editor
If you're lucky enough to have an art department, you can get them to do this stuff for you; if not, you need to learn how to do it yourself.

I like to store my original images in vector form -- lines and shapes -- as opposed to bitmapped images, so I can resize them without losing detail and make new similar ones easily.

I use CorelDraw, which is adequate -- all right for the price.

A bitmap graphics editor
By which I mean something better than Windows Paintbrush. Again, I use CorelDraw because it's what I have, but Adobe Photoshop seems to be preferred by artists, probably mostly because it uses terminology they're familiar with. CorelDraw uses more geek terms, which is OK with me. Incidentally, the clip art I was complaining about came with Corel.

A decent programming font
A lot of people like the Proggy fonts. These are monospaced fonts that make it easy to distinguish between similar-looking characters and look nicer than Courier. If you've ever had a program that wouldn't compile because you had an "l" in a variable name in one place and a "1" in another, this is for you. (If it compiled but didn't work, then shame on you for not using Option Declare).

The one problem with the Proggy fonts is that they don't scale up well (not even the TrueType versions). Since I give presentations and like to be able to show code large enough for the audience to read, I use Andale Mono.

Other tools
Julian Robicheaux's NSF tools have been recommended to me recently by someone whose opinion I respect. I haven't had time to try them out myself, but they look promising.

Rocky Oliver's blog lists some free tools he's found useful.

And finally…
Again, I encourage responses to my ravings. If there are tools you like that aren't listed here, please reply with your favorites. Also, if you have critter mugshots of your own, please send them along.

Posted by Andre Guirard Coneys ate my marigolds
15 FEB 2005 06:17 EST (11:17, GMT)
Our neighbors have a squirrel feeder in their yard. The logic behind this escapes me. Squirrels are pests -- rats with fuzzy tails. They chase birds away from our bird feeders. They chew through things -- including wooden birdfeeders and the cords by which bird feeders hang. They're not the least bit colorful. They're insolent. Who needs 'em?

Another neighbor harbors rabbits under a shed in their back yard. Rabbits are also a member of the rodent family. They don't just tolerate them -- which would be bad enough -- they feed them. Do you know what you get when you feed bunnies? Dozens of hungry little bunnies. Baby rabbits have even less sense than the adults; they'll eat anything, even things that they supposedly don't like. Last spring they ate all the bark from around the base of one of the trees that we drove all the way to Wisconsin to get. It'll probably die. We had to put wire cages around all our saplings and baby shrubs, so our yard now looks like a tree zoo. They even ate our white marigolds. In case you're not a gardener, you should know that people plant marigolds around plants they want to keep rabbits away from, because the rabbits supposedly don't like the smell. And yet ours were eaten, all the way down to the ground.

Don't tell our neighbors, but we have a trap and we're going to catch and relocate as many of those rascals as we can (the rabbits, not the squirrels -- squirrels are merely annoying; rabbits are a menace. My wife Rebecca is the real gardener in the family, so she takes it more personally than I do. She just wants to get a pellet gun and send the little whatnots to bunny heaven or wherever they would end up.

(She's looking over my shoulder now and exclaiming, "You lie!" I may be exaggerating a little -- she wouldn't shoot them herself. She does talk about it, but don't worry, the bunnies are safe.)

(By the way, you may recall yesterday I said I'd get even with her for that pun.)

Speaking of heaven, (as Marlin Perkins might say), in programmer's paradise, nobody ever has to write any code that someone else has already written; they just copy it and plug it in to their new code.

It's going to be at least a couple of years before we attain that level of reuse here on Earth. But, in the meantime, any code you can find and reuse gives you that much more time to take that pellet gun and wait by the birdfeeder for the squirrels to arrive. So, before you write code, go search for an existing answer -- the birds will thank you. They'll also poop all over your car, but that's birds for you.

Some developers hoard bits of reusable code in much the same way that squirrels hoard nuts. Unlike squirrels (and fortunately for us), however, a few of them share their collections with the general Domino developer public. Of course, you can go to SearchDomino.com or the LDD forums and search -- always a good way to find answers to a question. But if you're looking for reusable code, there's a lot of chaff to sort through. So you're better off in that case going straight to the sources of high-quality pre-written subroutines and classes. Here's my list of best places to look for code. Readers, please chime in with any good ones I may have missed!

  • OpenNTF.org -- This is a terrific source of complete applications that you can copy free of charge, though I encourage you to make a voluntary contribution to the authors of the application. The nice thing about open source communities is that they're packed with smarties -- er, experts -- who find the flaws in applications others post and either correct them or, at least, point them out so that the project owners can correct them. It makes sense to browse through these and see what's available. You might even see some things you can use right away in your environment.

    Beside the complete applications, there's also a "code bin" that shows how to do a plethora of useful tasks. This isn't maintained at as high a standard of quality as the applications are, but anything that's very wrong is at least likely to get commented on by the aforementioned experts, in time. So do read the comments posted in response to the code bin items!

  • Martin Scott Consulting -- An online compendium of reusable code from a variety of sources, including many LotusScript functions (and function libraries), complex macro formulas, Java classes and C API code. An excellent resource.

  • Codestore.net -- Run by Domino expert Jake Howlett, this U.K. site has a good collection of mostly high-quality code from Jake and many other contributors.

  • IBM Lotus DeveloperWorks Sandbox -- This has a lot of good examples in it as well as downloadable applications that you can install and use. It doesn't, however, have the same level of quality control as some of the other sources listed here. Always read the comments others have posted.

  • The View magazine -- Subscribers of this publication find it a good source of reusable code. Non-subscribers, though they can't read the actual articles without paying for a reprint, can still go to the Web site and, at no charge, download the sample files that accompany some articles. These are a good source of material for study and imitation. The articles in The View all go through a peer review process of sorts, though, in my experience, this applies only to the text of the article, not the design of any accompanying databases.

  • TechTarget's Expert Answer Center and SearchDomino.com -- You probably already know about these sites, since you're here reading my blog. The expert answers are more reliable than the tips, which is why they call them experts. On the other hand, the tips are somewhat more likely to contain actual code. Again, pay attention to any comments people have answered at the end. And, do the rest of us a favor -- please don't vote on how good a tip is until you've actually tried it out! These are mostly not tested very thoroughly, and may easily fail if used in a situation the author didn't anticipate.

  • SapphireOak.com -- Rocky Oliver, the heart of SapphireOak, speaks at a lot of conferences. And usually when he does, he makes a nice sample database to demonstrate how to do whatever it is he's talking about. The downloads section of his Web site contains several of these samples. These are generally not perfectly finished applications, because they're just a demonstration of the technology, but they do contain large chunks of code you can reuse.

  • Domino Design Library Examples -- The examples in this database were all written or collected by me and Rocky Oliver. We tried to make sure that they are all of high quality, and I recently updated some of them for compatibility with ND6. The download includes a Notes database and a template. The database contains code snippets and documentation for the design elements that are stored in the template. Since some reusable tools in the template involve multiple design elements, the tool description documents contain a control to automatically copy all the needed design elements to a database you specify. You can also, of course, add your own bits that you've developed or swiped from elsewhere, making this a good personal or departmental repository.

  • The Domino Designer 6 Developer's Redbook -- This book is a "how to" of Designer features and language information, not a code library. But the sample database that comes with it contains several examples of processing Rich Text using LotusScript.

  • The Sametime Center database (stcenter.nsf) -- Available from Lotus, this is a good example of how to design Domino Web applications. Study the design and see what's there that you can borrow.

Disclaimer: No amount of peer review (or absence of criticism by the Web public) is a substitute for testing the code thoroughly yourself before putting it into a production application. The ultimate responsibility for making sure something will work in your environment and specific circumstances is yours.

Of course, the other side of finding other people's code to reuse is giving back. It makes sense, when you write your own code, to make it reusable if only so that you can reuse it yourself and in your company (about which I'll write more another day). And once you have some reusable code, why not share? Several of the above sites are eager to receive well-written code to post online. And then you will be famous and a beloved of the Domino developer community.

Good luck -- and good huntin'!

P.S. No rodents were harmed in the production of this blog entry.
Posted by Andre Guirard Lotus Notes is not a toy
14 FEB 2005 05:46 EST (10:46, GMT)
When my wife found out that I would be starting my blogging stint on Valentine's Day, she suggested I pick an appropriate topic. "You should write about a relational dating-base," she told me. I will get even later -- right now, I have to write my blog.

For the next two weeks, I'm going to talk about quality factors in Notes/Domino development. Notes can be a real development environment for real, large-scale, mission-critical applications. But that only works if you treat it the way you would any other system for developing important applications. You need processes, standards, methodologies, tools and serious testing.

Many developers of Notes applications do not come from an IT background; this is in contrast to developers of most other application development platforms and is in part because Notes is a comparatively easy platform to develop on. Notes comes with many applications that can be "tweaked" to do what you want, and throwing together a simple custom form or view is easy to do with little or no coding. The payoff for even a simple application can be terrific, if that application addresses an unmet need or automates a previously manual process in a department. An application does not need to be perfect to be useful -- maybe it lets you leave a field blank that should be required, or it isn't really secure, or the performance could be better. But, by golly, it's 100% better than the way the same job was done in the past.

This is fine when a department owns an application, and the person who designed it is still there to fix it when it breaks. But say you want to roll out an application to thousands of users, or you must meet a more stringent standard (perhaps for regulatory reasons), or you want to sell it as a product. The application then needs a higher level of quality. Over the next couple of weeks, space permitting, I'll discuss several aspects of Notes/Domino application quality that affect productivity, cost and risk, including:

  • Setting up a development and testing environment. Does yours prevent accidental release of incomplete designs thru replication?

  • Standards and best practices for top-notch applications. How to decide on and enforce a sensible set of guidelines for application developers. Not every good idea makes a good rule.

  • Common errors in Notes/Domino applications. And what to do instead.

  • Resources for high-quality code samples and free reusable designs.

  • Design for reuse. Object orientation and flexible design. Maintain a library of parts you can plug into new applications. Catalog what's in the library so developers can find it when they need it!

  • Design for maintainability. Your developers have better uses for their time than to add words to keyword lists -- or to try to puzzle out how an application someone else did works. Your support staff needs complete information about any errors your users run across so they can quickly resolve the issue -- or get the information they need to pass on to a developer -- and get to the next person on the phone queue. Application owners need to be able to do simple maintenance themselves -- without a Designer client -- rather than waiting for someone to get to their request.

  • Design for accessibility. Can blind or low-vision users use the application?

  • Design for performance and scalability. Often the obvious way to do something is the slow way. Some common problems and a better way to do the same thing.

  • Design for security. Hide formulas and view access control lists don't cut it.

  • Creating superior user interfaces. A few simple rules that help you think about whether users will be able to use your application easily. Whose companies today have the resources to provide extensive hands-on training? Your applications need to stand on their own and empower end users to be self-sufficient within it.

  • Improving your development process. How to get a team working together smoothly on an application, using code reviews to detect errors when they're less expensive to fix.

  • Testing your application. Too many applications just get "tire kicking." When you have to make sure it's correct, a formal approach to testing is best.

  • Best tools for developers.
There will be reading assignments. There's a lot already out there about most of these topics, and much more to say about all of them than I have room or time for, so I'll summarize and point you to other blogs, articles and books by people who already said what I want to say. I hope that you, the readers, will also contribute your suggestions and links to additional resources.

There are whole disciplines of project management, software engineering methodologies and tools that are a closed book to many Domino developers. I don't pretend to cover it all or even know it all myself. But I want to give you a little peek at a wider world.

Oh, and happy Valentine's day! I hope you are your valentine's valentine. And if you should by some mischance find your evening free, you could distract yourself and put the time to good use by thinking about improved error handling in your Domino applications or learn how to implement a company-wide error handling system.
Posted by Andre Guirard

MOST RECENT BLOG TOPIC ENTRIES
JUL 2008
    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    
PREVIOUS ENTRIES OTHER BLOG TOPICS