I started work today on building out the documentation for External Dependencies.
External Dependencies are used within the .Domino framework as a way of documentin g links to external applications via meta-data. This brings a number of advantags to the application.
- Documentation of external dependencies allows an analyst/developer to make a quick assessment of the extent to which an application is linked to others. This is an important part of application documentation that is often forgotten or left outdated.
- Storing the details of dependencies in the form of meta-data allows changes to be made to the location of external dependencies without the need for programming changes.
- Storing the details of dependencies in the form of meta-data allows a change to be effected with a single change.
- Storing the details of dependencies in the form of meta-data makes it possible for development, QA, and production instances of an application to maintain links to different external sources.
One of the technques I developed for working with external dependencies was to create a Static Property for the database to avoid the need for locating the database each and every time. The first time Application A has need to refer to Application B it searches for an external dependency document that defines the location of the database and then opens the database. On subsequent attempts it refers to the chached copy of the database object.
Example:
'/**
' * Provide static link to Subpoena database
' */
Static Property Get FACTSubpoenaDatabase As FACTSubpoenaDatabase
Static This As FACTSubpoenaDatabase ' Static reference to Subpoena database
Dim ExternalDependency As DominoExternalDependency ' External dependency defining location of Subpoena database
Dim SubpoenaDB As NotesDatabase ' Subpoena Database
If This Is Nothing Then
Set ExternalDependency = New DominoExternalDependency(EXTERNAL_DEP_SUBPOENA_DATABASE)
If Not ExternalDependency.Document Is Nothing Then Set SubpoenaDB = ExternalDependency.GetDB
If SubpoenaDB Is Nothing Then Set SubpoenaDB = Session.CurrentDatabase
Set This = New FACTSubpoenaDatabase(SubpoenaDB,"" )
End If
Set FACTSubpoenaDatabase = This
End Property