Agent Structure Ideas

Attribute(s)

lotuscript, agents, object oriented, class, subclass, error handling

Description

To provide a common structure for agents and script libraries; especially ones that are part of OpenNTF

In the Initialize routine:

- use a catch-all error handler (ex.: on error goto my errorhandler)
- use for setting main/global variables and environment details or calling a setup routine)
- use a separate Main function to do the processing routines
- use settings documents (allows for dynamic, runtime management of agent behavior)
- set agent document selection to gather settings documents

General preferences

- use functions not subroutines, and have all functions return something set explicitly (don´t rely on the default)
- use an error handler in each function
- use a Select Case block to handle specific errors in the error handler routine (as opposed to multiple 'on error' statements)
- use Object-oriented practices
- use script libraries to contain custom classes
- use sub classes (ex: class MailLogItem as LogItem), especially when using someone else´s class library

Motivation

I thought I´d post a way of structuring an agent. I look forward to other recommendations, philosophies and feedback.

Example / Details


Links

here's a link to someone else's ideas on ways to improve on development:
Lotus Notes Domino application development best practices:
http://go.techtarget.com/r/4009541/955564