A modern architecturereview–usingcodereviewtools-ver-3.5
Top Tips Every Notes Developer Needs To Know
1. JMP102 The Top Things All New IBM Lotus
Domino Developers Need To Know
Kathy Brown | Application Developer
Thomas “Duffbert” Duff | Application Developer
2. Agenda
● Coding Best Practices
● Application Architecture
● Languages and Features
● Learning
● User Interface
● Everything Else
2
3. For the love of all that is holy...
Option Declare
3
11. Option Public
Option Declare
Use "OpenLogFunctions"
Sub Initialize
Example #2
OpenLog
Dim session As New NotesSession
Dim dbThis As NotesDatabase
Dim viewThis As NotesView
Dim docThis As NotesDocument
Dim dtCutoffDate As NotesDateTime
Dim varCutoffDate As Variant
On Error Goto logError
Call LogEvent("Purge Older Than 4 Months Agent Started", SEVERITY_LOW, Nothing)
' <insert your agent code here>
Call LogEvent("Purge Older Than 4 Months Agent Ended", SEVERITY_LOW, Nothing)
Exit Sub
logError:
Call LogError
Exit Sub
End Sub
11
12. All it takes are these
two libraries to give you
what you see below...
12
13. Thank you, Julian Robichaux, for OpenLog
http://www.openntf.org/projects/pmt.nsf/ProjectLookup/OpenLog
13
15. Users never change their minds, right?
Can you change
“Mommie Dearest”
to “Mommy Dearest” Jones made partner.
in all field options? We’ve changed the
company name.
Again.
15
19. ● Things to consider:
Print statements in LotusScript
@Prompt statements in Formula
alert() in JavaScript
LotusScript debugger (more to follow on that)
Don't test your own code
Test edge cases
Load test... with more than 20 documents!
Unfortunately, no xUnit for Notes...
19
26. Things to Consider
● Purpose of project
● Who are the key players of the project?
● Who are the end users?
● Length of time given to complete project
27. Agenda
● Coding Best Practices
● Application Architecture
● Languages and Features
● Learning
● User Interface
● Everything Else
27
30. ● You can use @Formula in Lotusscript with Evaluate
' For each document in a Notes database, use a Notes macro to
' compute the average for a list of numeric entries in the
' NumberList field. Evaluate returns a Variant, and Notes
' macros return an array. In this case, the array contains only
' 1 element (element 0). For more info, see the Notes
' documentation.
Sub Click(Source As Button)
' The macro text must be known at compile time.
Remember Const NotesMacro$ = "@Sum(NumberList) / @Elements(NumberList)"
this line... Dim result As Variant, j As Integer
Dim db As New NotesDatabase("", "MYSALES.NSF")
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Set dc = db.AllDocuments
For j% = 1 To dc.Count
Set doc = dc.GetNthDocument(j%)
result = Evaluate(NotesMacro$, doc)
MessageBox("Average is " & result(0))
Next
End Sub
● And you can use @Formula in Xpages with SSJS!
30
34. DXL lets you view data and design elements in XML
format. You can export, transform, and import that XML
into and out of your Notes database... Imagine changing
all the occurrences of a font name or some other design
element by doing a Find/Replace!
But be careful!
DXL does not
have 100%
fidelity, so you
could lose
important data
from your
datab...
34
54. Document the business requirements
Document changes to the business requirements
Document your proposed solution to the business
requirements
Document acceptance/rejection from both you and
the client of proposed solution
Document time projections
Document changes to requirements made after time
projections
Document anything and everything you can think of
54
62. ● SO many things you can look for...
●
●
GetNthDocument vs GetNextDocument
●
● NoCache on @DbLookups
●
● AutoUpdate on views
●
● Repeated @DbLookups
●
● Refreshing form on each field
●
● View indexing
●
● @Today in views (@Now also)
●
● @IsResponseDoc vs. @AllDescendents
62
64. Question and Answer Time!
Contact Information:
Kathy Brown - kathysrunningnotes@gmail.com
Blog: Running Notes - http://www.runningnotes.net
Twitter: kjbrown13
Thomas “Duffbert” Duff - duffbert@gmail.com
Blog: Duffbert's Random Musings - http://www.duffbert.com
Twitter: duffbert
Don't forget to turn in your session evaluations! This was session JMP102 – Top Things All
New Notes and Domino Developers Need To Know