Domino Environment Part II: Library Templates
Bookmark :
With an understanding of why templates should be used for database development from Domino Development Part 1 - Environments . Lets take a look at what other benefits there are to developing in templates. I use two different types of templates: library & design. Both of these templates never migrate from the development environment. The library will be for reusable code, and the design will be used with third party applications. I will save the design template for Part III.
With an understanding of why templates should be used for database development from Domino Development Part 1 - Environments . Lets take a look at what other benefits there are to developing in templates. I use two different types of templates: library & design. Both of these templates never migrate from the development environment. The library will be for reusable code, and the design will be used with third party applications. I will save the design template for Part III.
Rule #1: Never use Prohibit design refresh in a template (See Domino Development Part 1 - Environments).
Rule #2: Use Design inheritance to maximize code reuse.
Rule #3: Database inheritance should only occur with databases, except for third party package enhancements. (Part III)
Prohibit design refresh
The only place that I have found value with this setting is in databases. The best example is your mail database each folder you created has prohibit design refresh set otherwise the folder would be deleted at night when the design task runs on the server. This same setting can be used in applications for views, agents or any other design elements. Prohibit design refresh can actually be a hindrance even in a database, because the design never can be updated. Lotus realized this during upgrades of mail databases, so they added a new formula option to update a folder based on a different view. Check out the 'Upgrade Folder Design' agent in the Mail 6 template, or 'Upgrade this folder or view to R5 design' in the Mail 5 template.Any time a new design element is created with the 'Inherit from Master Template' set, the prohibit design refresh will automatically be checked. So if a new agent, form or view was created in your mail database it would have the prohibit design refresh enabled. This prevents it from getting deleted when the design task runs.
Design element inheritance
Inheritance in Domino follows the same concepts as OO. In LotusScript (which has OO characteristics) classes can inherit from another class which is like database inheritance. Design element inheritance resembles the method or property of a class, because they can be overridden or defined differently in each class. Following the same concept of other OO based languages lets start building a framework or library for the Notes/Domino environment. The library will reside in a template, there could be multiple templates (Notes, Domino, web, admin, mobile). Don't get to detail with the library templates they will be hard to maintain. These library templates will hold reusable design elements like subform footers, script libraries, an all documents view, or a hybrid of design elements.Reusable Footer Example
The footer contains the date and time of when someone created and last updated a document. This subform should always inherit so fixes and new features can easily be implemented. Let's assume the subform is in the 'Domino Library Template' with the 'Master template' property set to 'Domino Library Template'.Implementation
- Open the 'Domino Library Template'
- Select the subform 'User Info Footer'
- Select Edit-Copy from the menu bar
- Open the destination template
- Select Edit-Paste from the menu bar.
- Select 'Yes' when prompted to inherit future changes
That is 6 more steps than I want to do and this is simple. When there are multiple design elements that are needed the task can become tedious and error prone. Each design elements need to be selected based on the design type and then repeat steps 3-6 for each. To easy the pain copy and pasting the design elements I created a tool to accomplish this. Quick Elementer will group multiple design elements and allow the implementation of the design elements in a click or two. It is very much like the group objects in Teamstudio's Design Manager (formally Teamstudio Librarian). It will also set the inherit from Master Template property automatically.
Hopefully Part II will not take me three months to write. Don't forget to check out Quick Elementer






