« Return to the blog entry
Would it make sense to not instantiate the objects for the directory object and ($VIMPeople) view object?
Then, wrap "get" properties around the directory and ($VIMPeople) view objects. You could check to see if the object is first instantiated (is nothing) and if it is you could instantiate it just once.
Property Get PeopleView as Notesview
if Me.vimpeople is nothing then
set Me.vimpeople = NAB.getview("($VIMPeople)")
set PeopleView = Me.vimpeople
Property NAB as NotesDatabase
if Me.directory is nothing then
Set Me.directory = New NotesDatabase(Me.database.Server, "names.nsf")
set NAB = Me.Directory
I think it's some sort of design pattern but I can't remember which. This way you don't waste time and resources for the agents that don't use those objects.