IBM Lotus Domino Development Best Practices
IBM Lotus Domino Development Best Practices
IBM Lotus Domino Development Best Practices
- TAGS
- domino
- server
- applications
- documents
- index
- database
- xpages
- fields
- multiple
- elements
- lotus
- practices
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Redbooks: <strong>IBM</strong> <strong>Lotus</strong> <strong>Domino</strong><br />
<strong>Development</strong> <strong>Best</strong> <strong>Practices</strong><br />
Robert Baehr<br />
Andre Guirard<br />
Thomas Hampel<br />
Abhishek Jain<br />
Matt Holthe<br />
Shabbir Shaikh
Preface<br />
Important Note about referencing the latest information<br />
This PDF document represents the overall Redbooks Wiki for <strong>Lotus</strong> <strong>Domino</strong> <strong>Development</strong><br />
<strong>Best</strong> <strong>Practices</strong>.<br />
In addition to the information contained in this document, also refer to the complete <strong>Lotus</strong><br />
Redbooks Wiki at the following URL:<br />
http://wiki1.swg.usma.ibm.com/ldd/ddwiki.nsf/<br />
Select "<strong>IBM</strong> Redbooks Publications" in the navigation. Select "Redbooks Wiki: <strong>Domino</strong><br />
<strong>Development</strong> <strong>Best</strong> <strong>Practices</strong>" in the navigation. There are tips for navigating the guide on this<br />
page.<br />
Meet the Authors<br />
Robert Baehr (Bob) is the Manager of Business Systems and<br />
<strong>Development</strong> for S.R.I. Quality System Registrar, a pioneer and world<br />
leader in Management System Registration. His experience with<br />
<strong>Lotus</strong> Notes and <strong>Domino</strong> spans two decades (since Release 2),<br />
offering software design, system integration, and data integration<br />
services to small business through global corporations. Bob was<br />
honored to speak at <strong>Lotus</strong>phere 2009 at the request of the <strong>Lotus</strong><br />
Foundation's management team. He has been a <strong>Lotus</strong> Certified<br />
Professional Developer, Administrator, and Instructor since <strong>Lotus</strong><br />
Notes Release 3. Bob currently resides in Cranberry Township,<br />
Pennsylvania with his fiance, Cindy.<br />
Andre Guirard is a longtime <strong>Domino</strong> developer, former consultant,<br />
and for many years a member of the Notes/<strong>Domino</strong> product<br />
development team. He is a frequent presenter at <strong>Lotus</strong>phere and other<br />
conferences, author of many articles on development topics, an<br />
OpenNTF contributor, an occasional presence in the LDD forums, and<br />
he blogs about <strong>Domino</strong> best practices.<br />
Thomas Hampel is an IT Architect at <strong>IBM</strong> Germany. His key areas of<br />
focus are migration projects, performance and delivery service<br />
architecture for customers who outsourced to <strong>IBM</strong>. He is working with<br />
<strong>Lotus</strong> <strong>Domino</strong> since version 3 and is an <strong>IBM</strong> Certified Advanced <strong>Lotus</strong><br />
Developer as well as <strong>IBM</strong> Certified Advanced <strong>Lotus</strong> Administrator in<br />
various versions up to 8.5. He is also an <strong>IBM</strong> Certified Advanced<br />
Security Professional.<br />
2 of 217
Abhishek Jain is working with <strong>IBM</strong> India Software Labs since 2004<br />
and has been in the industry for 10 years. He is currently working as<br />
an IT Specialist with <strong>IBM</strong> Collaboration Services and is skilled on<br />
various <strong>Lotus</strong> products. He is a Certified <strong>Lotus</strong> Professional, Certified<br />
<strong>Lotus</strong> Administrator, and a Certified <strong>Lotus</strong> Instructor on both <strong>Lotus</strong><br />
<strong>Domino</strong> Administration and <strong>Development</strong>. Abhishek has been a part of<br />
earlier RedWikis Customizing Quickr 8.1 and <strong>Best</strong> <strong>Practices</strong> for<br />
Building Web Applications for <strong>Domino</strong> 8.5.1. He has also published<br />
developerWorks articles Integrating <strong>IBM</strong> <strong>Lotus</strong> Forms with <strong>IBM</strong> <strong>Lotus</strong><br />
<strong>Domino</strong> and Auto-zipping <strong>Lotus</strong> Notes Attachments.<br />
Matt Holthe is a Certified IT Specialist at <strong>IBM</strong> in Bloomington, IL. He<br />
works as a Field Service Engineer, assisting <strong>IBM</strong> Premium Support<br />
customers with <strong>Domino</strong> - anything from application assistance, to<br />
server upgrades, to new feature enablement. He started working with<br />
<strong>Lotus</strong> Notes version 3.3 in July of 1995. He has been dual certified in<br />
<strong>Lotus</strong> Notes Application <strong>Development</strong> and <strong>Lotus</strong> Notes System<br />
Administration for versions 5, 6, 6.5, 7, 8, and 8.5.<br />
Shabbir Shaikh is a System Analyst, and a technology enthusiast<br />
working with <strong>Lotus</strong> Center of Excellence in Capgemini, India. For over<br />
10 years, he is into solution, designing, and development of<br />
collaborative applications using <strong>Lotus</strong> <strong>Domino</strong> technology for<br />
manufacturing, insurance, retail, and banking sector. He has<br />
experiences working on process related key roles such as Business<br />
Analyst, Offshore Project Coordinator, Project Quality Lead, and<br />
Configuration Manager in several engagements. He is an equally<br />
enthusiastic trainer to share knowledge on <strong>Lotus</strong> Application<br />
<strong>Development</strong> best practices by conducting technical training and<br />
seminars.<br />
Special thanks to the following people for contributing<br />
to this effort<br />
We wish to acknowledge a special thank you to the following sponsors and key<br />
stakeholders from the <strong>Lotus</strong> Forms <strong>Development</strong>, Product Management, and <strong>Lotus</strong> IDC<br />
Teams:<br />
1. Amanda Bauman - Everyone Writes and IDC Wikis Program Manager<br />
2. Peter Janzen - <strong>IBM</strong> Senior Product Manager<br />
Additionally, we wish to thank the following members for their technical help and<br />
contributions to this wiki:<br />
1. Stephan Wissel - <strong>IBM</strong> Collaboration and Productivity Advisor , http://www.wissel.net<br />
2. Chris Toohey - Blogger, podcaster, writer, and geek, http://www.dominoguru.com<br />
3. Hunter Medney - <strong>IBM</strong> Senior I/T Specialist<br />
4. Bruce Lill - <strong>Lotus</strong> <strong>Domino</strong> developer and administrator, Kalechi Designs<br />
5. Whei-Jen Chen - <strong>IBM</strong> Project Leader at the International Technical Support<br />
Organization<br />
3 of 217
Chapter 1. Introduction<br />
With Version 8.5.3, <strong>IBM</strong>® <strong>Lotus</strong>® <strong>Domino</strong>® Designer® software further improved its<br />
reputation for being a premier collaborative application development tool for <strong>Lotus</strong><br />
<strong>Domino</strong> software-based applications. <strong>Lotus</strong> <strong>Domino</strong> Designer helps companies improve<br />
employee productivity by building and deploying <strong>Lotus</strong> <strong>Domino</strong> applications more quickly,<br />
thereby, enabling organizations to be more responsive to changing business initiatives.<br />
Within this document, we share thoughts and industry best practices about how efficient<br />
application development in <strong>Lotus</strong> <strong>Domino</strong> can look like. The document discusses certain<br />
powerful application development features of <strong>Domino</strong> XPages development technologies<br />
by showing how a developer can apply best practices to efficiently create or extending<br />
the functionality of for an existing <strong>Domino</strong> application. Ideas and concepts presented are<br />
meant to be an introduction and do not claim to be a complete list.<br />
This wiki covers what is needed to build or enhance an application regardless of client<br />
and the general practices to make development easier, less time consuming, and easy to<br />
support changes within the lifecycle of an application.<br />
Finally, we offer instructions on infrastructure and operational improvements which can<br />
benefit performance and maintainability of your environment.<br />
4 of 217
Chapter 2. Application development lifecycle<br />
Application development lifecycle is a commonly used and integral part of application<br />
development. It is not a new concept, however, is often under utilized by the developers.<br />
In this chapter, we discuss the best practices to manage the <strong>Domino</strong> application<br />
development lifecycle to help you achieve the standardization and stability to the <strong>Domino</strong><br />
application development.<br />
The following figure shows the phases in application development lifecycle. It is a<br />
continue process because the business evolves and the applications are enhanced<br />
continuously.<br />
What are the benefits of standardization of <strong>Domino</strong> application development lifecycle It<br />
helps streamline the different phases of the application development. It weaves all<br />
phases through a common thread which leads to logical progression from one phase to<br />
another. Builds a strong foundation of requirements on which you establish the pillars of<br />
application design. It helps conceptualize and brings focus to several aspects of<br />
application design. This actually leads into transformation of the business requirements<br />
into an application development.<br />
The application development lifecycle further drills down to the actual code generation of<br />
the requirements in a standardized manner that brings the application to life. Emphasis<br />
on quality aspect of the application been developed that should agree with the expected<br />
business requirements. It also provides a platform to stage the application for the user to<br />
confirm the application acceptance that agrees with business requirements. Finally, it<br />
helps the movement of developed application to make it live in production for its usage by<br />
the business.<br />
2.1. Introduction<br />
With a growing number of members in a development team, it is essential to clarify how<br />
to structure, plan, and control the development project. Readers of this document might<br />
not be new to application development in <strong>Domino</strong>, here we provide a brief review about<br />
the software development project methodology. Following the software development<br />
methodology selected by your company is essential for a successful application.<br />
The waterfall method is a commonly used application development methodology. It is a<br />
sequential development approach, in which development is seen as flowing steadily<br />
downwards (like a waterfall) through the phases of requirements analysis, design,<br />
5 of 217
implementation, testing (validation), integration, and maintenance. Each stage is<br />
supposed to finish before the next phase starts, or at least have a minimal overlap only.<br />
Each phase of the project has to be signed off by the customer and his stakeholders.<br />
While the classic waterfall methodology ends with "maintenance", most projects,<br />
including <strong>Domino</strong> applications, are often extended or upgraded throughout their lifetime.<br />
Though each upgrade might be handled as a project by its own, we discuss application<br />
upgrade and retirement here together with these application software development<br />
phases.<br />
For more information about software development methods, refer to the following:<br />
DeveloperWorks article Introducing the <strong>IBM</strong> Rational Unified Process essentials by<br />
analogy: http://www.ibm.com/developerworks/rational/library/05/wessberg/<br />
Crystal Clear by Alistair Cockburn, ISBN-13: 978-0201699470<br />
2.2. Requirements<br />
In application development lifecycle, requirements literally means: the functional and nonfunctional<br />
needs of the business. These needs become the goals for the application<br />
development team. Requirements are the most critical factor in the success of any<br />
application development project for one simple reason: it defines what is required by the<br />
business to address it needs. It is important to define, communicate, and understand the<br />
requirements exactly the way it is supposed to be meant. Any ambiguity wording,<br />
misinterpretation, or missing information associated with requirements it results into nonconformance<br />
to requirements. Any lapse in the requirement phase that goes undetected<br />
can cost you more to rectify this at later stage. It impacts all critical parameters (quality,<br />
efforts, and schedule) that define the success or failure of the application development<br />
project.<br />
<strong>Domino</strong> application development generally has a short duration of application<br />
development cycle. Considering <strong>Domino</strong> being a rapid application development platform,<br />
it leads to a common issue that the development teams do not allocate sufficient time and<br />
attention necessary to manage the requirements appropriately.<br />
In this section we discuss the best approach about requirement management, gathering,<br />
and prioritization.<br />
6 of 217
2.2.1 Requirement management<br />
Requirements are discussed and defined during the requirement phase and it continues<br />
to refine over the period of application lifecycle. The requirements and its degree of<br />
details vary depend on the awareness of the problem and benefit to gain by resolving the<br />
problem. The requirements origin is the problem statement, which is the purpose to<br />
formulate the requirements to address that problem. Business envisions the benefits of<br />
solving an existing problem or altogether innovates its existing process to achieve a<br />
competitive advantage. The purpose of requirement management is to organize the<br />
requirement, document it, verify that the requirement to ensure it meet the needs and<br />
expectation of the business and the stakeholders involved. To understand the<br />
requirements, a holistic approach has to be adapted, a proper consideration to be made<br />
to identify the functional and non-functional requirements.<br />
A functional requirement is the primary functional features that the business expects from<br />
the proposed system to perform to address the specific problem. For example:<br />
The product quality application must allow only the users from quality audit team to<br />
submit a quality audit report.<br />
The following are some of the common of functional requirement items:<br />
Data input, output, and processing behavior: Such as the data input and output<br />
screens, data format, and data processing.<br />
Business rules and logic: Such as the task to be performed, data validation, data<br />
calculation, and data processes.<br />
Workflow requirements: Such as the application workflow, level of workflow,<br />
document routing, and mailing features.<br />
Interfaces with other system: Such as payment voucher to be generate using remote<br />
function call to a financial database.<br />
Security requirements: Such as document deletion access is only possible to a<br />
specific role.<br />
Reports or views: The data extraction based on query and representation in desired<br />
format.<br />
User roles and responsibilities: Such as a delegate person has option to make<br />
approval decision in absence of a primary approver.<br />
Error handling: Such as in event of failure to generate the payment voucher, how the<br />
order processing should be terminated, and how the log to be generated.<br />
A non-functional requirement is the requirement that enhance the functional<br />
requirements. Generally, it means the proposed system compliance with the constraints<br />
defined by the business. For example:<br />
The new member added to the quality audit team, must be able to use the system within<br />
4 hours of users enrolment in the audit team.<br />
The following are some of the common non-functional requirement items:<br />
Systems performance constraints: Such as the form load, refresh, or submission<br />
time.<br />
System security constraints: Such as restriction of directory listing, user authorization,<br />
data security.<br />
User interface constraints: Such as GUI screen layout, formatting, and color themes.<br />
Maintainability: Ease of maintenance of the proposed system. For example, ease of<br />
adding a new page to the system, ease to change color themes or static text such as<br />
label, ease to add new level of workflow.<br />
7 of 217
Usability: System usability. For example, system to be accessible using browser<br />
client, mobile, thick client.<br />
Availability: System availability constraints. For example, system to be available 24x7<br />
for the user access.<br />
Compatibility: System compatibility constraints. For example, cross-browser<br />
compatibility, multiple operating system platform.<br />
Internationalization: System portability to manage users from different locale and time<br />
zone. For example, system to support multiple languages and multiple time zone.<br />
Statutory constraints: The statutory or legal requirements. For example, enforce data<br />
access policy, audit trail for edit history.<br />
Hardware constraints: Systems ability to function within the limit of hardware<br />
constrains. For example, system to run at optimum level with 1 GB RAM.<br />
External Interfaces: System ability to integrate with external sources. For example,<br />
interface with Oracle, SAP, and third party tool.<br />
Operations: Systems compatibility with business operations constraints. For example,<br />
possibility for hot or cold system backup.<br />
A good set of requirements have the following characteristics:<br />
Correct: All requirements should tie back to a customer need.<br />
Unambiguous: A requirement should have only a single interpretation.<br />
Complete: All significant needs of users should be addressed.<br />
Consistent: There should not be any conflict within individual requirements.<br />
Ranked for importance: Ranking helps the team to address the most critical<br />
requirements first and to balance the resources to meet project objectives.<br />
Verifiable: A person should be able to determine that the developed software meets<br />
the requirement.<br />
Traceable: It should be possible to trace a components requirement to its source .<br />
Understandable: The user and developer community should be able to comprehend<br />
the complete set of individual requirements and the aggregate set implied by the<br />
document.<br />
<strong>Best</strong> practices<br />
Consider the following for requirements management:<br />
Separate each requirement point as an individual item to maintain a good level of<br />
requirement granularity.<br />
Assign number references to each requirement point and arrange them in the logical<br />
order of the flow of requirements as per the dependency on other requirements.<br />
As the requirement phase progress, keep requirement document updated with the<br />
renewed understanding after the interaction and query resolution activities with the<br />
stakeholder.<br />
Each requirement point should focus on a certain aspect. Elaborate each<br />
requirement point to a level until it is clear and no ambiguity. If other points come out<br />
as a result of elaboration, separate out those individual requirement points.<br />
Document the requirement in a simple and unambiguous manner, each requirement<br />
has to be unique and avoid duplication. It should be testable or verifiable during the<br />
testing phase.<br />
Maintain the requirement document versions regularly to keep the history of<br />
requirements evolution from the beginning. This helps to trace the origin of the<br />
requirement and every change or refinement done to the requirement. It also helps in<br />
maintaining the relationship between the requirements and their solutions.<br />
Plan a discussion at regular intervals with all the stakeholders to verify that the<br />
requirements are in line with the expectations by the business.<br />
8 of 217
o Identify risks and appropriate mitigation action and update the requirement<br />
document accordingly.<br />
In case of the requirement is complete for the enhancement of an existing system,<br />
the appropriate functional and technical impact analysis must be done.<br />
o Identify the regression test scenario after discussion with business, while you<br />
develop the requirement document for such cases.<br />
2.2.2 Requirement gathering<br />
Requirement gathering is a subphase of the requirement phase. In the requirement<br />
gathering phase, you identify the stakeholders, the requirement owners, from whom the<br />
requirement must be gathered. It is possible to have multiple sources for requirements<br />
when the proposed solution spans over more than one workgroup in an organization.<br />
You might given a draft requirement document or a simply a problem statement with<br />
expected benefits as the initial input from the stakehoders. On the basis of this, you have<br />
to gather, elicit, and engage interactions with the requirement owners to refine the raw<br />
requirements into meaningful and unambiguous requirement information.<br />
Technology is never a focus during the requirement phase. Assume that a business<br />
wants to leverage the existing investment in the <strong>Domino</strong> infrastructure. They intend to<br />
build some capabilities using the rapid application development platform of <strong>Domino</strong>.<br />
Below are some of the requirement gathering phases specific questionnaire for the<br />
<strong>Domino</strong> application development team:<br />
What are the problems to be solved by the proposed solution<br />
What are the historical background of the problems<br />
What is the scope of the proposed solution What are included and excluded from<br />
the proposed solution<br />
Are there any new problems the proposed solution could cause in the current<br />
system<br />
Which are the locations the customers use the application Are there any<br />
internationalization requirements<br />
What are the security requirements and statutory constraints for the proposed<br />
solution<br />
What are the access rights for the various users with respect to the application<br />
Is there a need for data consistency checks and activity logging<br />
What is the initial number of users for the proposed solution<br />
What are the possible unknown factors and assumptions<br />
What are the standards of performance or other quality attributes, which must be<br />
matched or exceeded in the proposed solution<br />
What system behaviors do the customer consider as a defect in the system<br />
Who are the users and the categories of users if any<br />
Are there any technical feasibility issue in addressing a particular requirement<br />
In case of doubt, do a feasibility study or better do prototype to understand business<br />
expectation properly.<br />
Are there any third party components or commercial components to be integrated<br />
with <strong>Domino</strong> application<br />
Are there any interfaces to the external data source system, such as RDBMS, web<br />
services, Microsoft Office components What are the expected system response<br />
times from external interfaces<br />
Is there any data that must be shared across applications<br />
What are the hardware limitations that could constrain the design options<br />
9 of 217
Are there any compliance constrains for the solution design to adhere some design<br />
or programming standards of the client<br />
Are rich GUI features required for example, drag and drop, multiple pop-ups, charts,<br />
dynamic data refresh.<br />
Are there any customer standards or guidelines to be complied with while designing<br />
the user interface<br />
Will the customer provide screen layouts, graphics, GUI details such as font style,<br />
size, and color<br />
Does the customer expect a prototype Does the customer understand that the<br />
prototype will be purely navigational and will not be functional<br />
Will the user provide the common messages to be thrown up by the application<br />
o Will the messages be classified into information, warning, and error<br />
messages<br />
o Will the information messages be made configurable for the business to<br />
manage message text<br />
What are the reports requirements the proposed solution has to provide<br />
o What are the purpose, intended audience, layout, and the source of data for<br />
each report<br />
o Are sample report layouts available<br />
For each item of input and output, What are the formats of data<br />
What are the business rules and validations associated with each user task<br />
Is the proposed solution to be available for usage on web browser, notes client,<br />
mobile, or a mix of different platforms<br />
What are the requirements regarding compatibility (for example, backwards, cross<br />
browser, and so on)<br />
Are there any constraints around the operating or development environment<br />
What are the internationalization and localization requirements<br />
Which are the different geographical regions, languages, and currencies that must be<br />
supported<br />
Input format differences (for example, date, time, and currency) from display formats<br />
if any<br />
In which format must the system store the information<br />
What is the expected peak usage in terms of the maximum number of concurrent<br />
users<br />
Is the number of users or size of transaction expected to grow in the future<br />
What is the volume or size of data to be stored and handled by system<br />
What are the intended major features that will probably provide the most value, at<br />
least cost, to the largest community of users, and this information to be used in<br />
requirement prioritization<br />
Query register sheet<br />
It is often that the requirements or the problem statement defined by the business is not<br />
detailed, lacks clarity, and needs clarifications from the business. The development<br />
project team has to allocate sufficient time for clarifying the requirements in the<br />
requirement phase. The clarifying action continues, though less frequent, throughout the<br />
application development life cycle. The clarifications have an influence on the projects<br />
technical and nontechnical decisions.<br />
Your project team should maintain a consolidated query register sheet to record the<br />
queries, assumptions, and the responses. This query register sheet should be placed at<br />
location which is accessible to entire project team. Appoint a single point of contact<br />
(SPOC) responsible to ensure the query register is up to date and follows up with the<br />
right person to get a response for the open queries. This sheet should include functional<br />
10 of 217
as well as non-functional queries or to record the assumption for confirmation. The query<br />
register sheet should be exchanged at regular intervals between the stakeholders.<br />
Formulate a format for the query register after discussion within your project team. Below<br />
is the sample general attributes of the query register sheet:<br />
Query description:<br />
Keep the language simple, non-ambiguous, one logical point at a time, if it helps the<br />
respondent, mention the original requirement context.<br />
Screen dump or exhibit:<br />
Any additional information such as diagram, flowchart, or screen images of a<br />
scenario or representation. Information that helps the respondent to understand the<br />
query in a much better way. It helps reduce the query resolution cycle time and the<br />
quality of response.<br />
Severity and impact:<br />
To understand the risk of delayed response, classify the items in the query register<br />
sheet as either high, medium, or low as per the impact or severity of clarification on<br />
the requirement.<br />
Criticality or priority:<br />
It is possible for your team to generate many queries, considering the limited time on<br />
the hands of respondent and dependency of the clarification on the requirement. You<br />
could indicate the criticality or priority probably in terms of color code (Yellow: Low |<br />
Orange: Medium | Red: High) to help the respondent to focus on the high and<br />
medium level of queries first in that order. It allows them to allocate comparatively<br />
focus efforts to draft a response with more attention to the details.<br />
Date raised:<br />
It is a good practice to track when the query was raised to understand the age of the<br />
query and appropriate risk mitigation action to be decided by the project team.<br />
Status:<br />
It helps the project team to check on the status of the queries for follow-up and<br />
communication with stakeholders, the possible suggested status are Open| Close|<br />
Awaiting Inputs| Cancelled| On-Hold<br />
Assigned to:<br />
It helps to track the person responsible for the clarification, and ease in follow-up<br />
activities.<br />
Date required:<br />
Indicating a date by when the response or the clarification is required. The date<br />
required section helps communicate the projects expectations of timeline to manage<br />
the overall timeline which might be impacted due to the delayed responses.<br />
Resolution summary and response:<br />
To capture the responses, the resolution summary, and the clarifications of the<br />
queries and the assumptions to trace the requirements and their refinement through<br />
the query resolution. These responses help refine the requirement document,<br />
removing any ambiguity or misinterpretation.<br />
Date resolved:<br />
The resolution date when the queries or assumptions are clarified. It helps in<br />
identifying the slippage by comparing the date required and the date resolved.<br />
Additional comments:<br />
Any additional comments or overall remarks about the query item in the register.<br />
<strong>Best</strong> practices<br />
Consider the following when gathering requirements:<br />
Plan for extensive user involvement to determine correctness of requirements.<br />
Educate the stakeholders, especially users, about the need for their involvement.<br />
Expect and plan for the changes in requirements, which are inevitable.<br />
11 of 217
Ensure to gather both functional and non-functional requirements.<br />
Understand and use the vocabulary of the domain for better level of discussion with<br />
the business user. Include the business terms in the glossary section, which should<br />
become part of the requirements documentation.<br />
Do not think about the solution at the time of requirement gathering, it leads to less<br />
focus on requirement and attention to details.<br />
Make a practice to use flip charts, diagrams, exhibits, prototypes, visual tools, and so<br />
on as a starting point and to understand the requirement in better way.<br />
Focus on understanding business point of view and users tasks rather than user<br />
interfaces<br />
Conduct requirements gathering meetings with the users instead of ad hoc querying<br />
them during their regular work.<br />
In case of remote requirement gathering, use technical aids to record user<br />
interactions. Make a point to ask the users’ permission before recording the<br />
discussion. It helps to trace the original discussion in case there is a change in<br />
requirement owners or the members in the project team.<br />
Ask open-ended questions, it helps to obtain more information from the user’s point<br />
of view.<br />
It is a good practice to document the rationale behind each requirement. It helps<br />
understand the primary objective of the requirement. It avoids any confusion to<br />
choose options which are favorable to this rationale at the time of selecting a solution<br />
among several alternatives.<br />
Try to probe and understand the users’ implicit expectations about the proposed<br />
system’s features, such as performance, usability, efficiency, and reliability. One of<br />
the approaches is to ask users what constitute as unacceptable performance,<br />
usability, or reliability.<br />
Do not hesitate to seek clarification for any doubt, unknown term, or ambiguous<br />
explanation. Explain to the user about the difficulty to understand the particular<br />
business terms been discussed, request for more elaboration.<br />
You can think of questions that were already asked, rephrase them from a different<br />
perspective.<br />
Maintain proper documentation of all the client's communication for future reference.<br />
2.2.3 Application documentation<br />
The application document is the final requirement document which is the output of<br />
requirement gathering and analysis. This document is generally known as the software<br />
requirement specification or system requirement specifications. This document should<br />
consist of a complete functional description as well as the behavior of system for all<br />
possible business use cases and its interaction with the users. In addition, the application<br />
document includes all non-functional requirements that enforce different types of design<br />
constrains.<br />
<strong>Best</strong> practice<br />
When producing the application documentation, consider the following:<br />
Keep sentences and paragraphs short. Use the active voice.<br />
Use terms consistently and define them in a glossary or data dictionary.<br />
To see if a requirement statement is sufficiently well defined, read it from the<br />
developer’s perspective to learn if it elaborates enough to design and implement.<br />
Do not merge multiple requirements as a single requirement point.<br />
It should have clarity about what is in scope and what is not.<br />
12 of 217
Every function and feature must be described in details with its appropriate nonfunctional<br />
constrains.<br />
Include use cases with appropriate use case diagram.<br />
Mention clearly the user acceptance criteria or the acceptance test scenarios for<br />
verifying the functions and feature and other non-functional constrains. This helps<br />
understand the benchmark expectation of the system for successful acceptance of<br />
the solution.<br />
2.2.4 Requirement prioritization<br />
Requirement prioritization is a must when there are multiple requirements but not all of<br />
them cab be implemented at the same time due to certain constraints. The constraints<br />
can be time, budget, development dependencies, as well as business and technical risks.<br />
During project development, there could be new requirements for statutory compliance or<br />
change in policy implementation that takes priority on other matters. The constraints from<br />
the development project team can be too aggressive schedule to manage all of the<br />
requirements, skills availability in development team, and so on. When prioritizing the<br />
requirements, it is important to arrive at a mutually agreed terms of all parties that could<br />
mean reducing scope or breaking the application into several releases. A proper<br />
requirement prioritization helps avoiding wastages ( time, effort, money, and other<br />
resources) and delivering the application features and functions in time for the business<br />
needs.<br />
Both business users and developers should work together in prioritizing the<br />
requirements. In the process, derive from the requirements a list of the high level features<br />
that are expected from the proposed solution. Assign the importance levels of high,<br />
medium, or low to each features. The business users are to determine the level of priority<br />
for each feature. The developers are to identify the level of complexity of each feature.<br />
The complexity indicates the difficult level (in terms of efforts) to deliver a particular<br />
feature. The developers should also identify the level of risk for each feature in high,<br />
medium, and low based on the impact on the system had the feature is not delivered in<br />
the release under consideration.<br />
<strong>Best</strong> practice<br />
Consider the following for the requirement prioritization:<br />
Identify the need for the prioritization of requirement.<br />
Prioritizing the requirements as early as possible to ensure the resources are<br />
invested for critical activities.<br />
It is essential for the user community and the development team to come to a<br />
common agreement on the prioritization.<br />
Obtain a user sign-off on the requirement prioritization sheet.<br />
2.3. Design<br />
<strong>Domino</strong> applications are designed to enable users to collaboratively complete a particular<br />
process of a business in a group. For example, product development application for<br />
manufacturing industry involves several stages, gates, and activities. These activities are<br />
to be performed by several workgroups with each having different level of access and<br />
constraints in the process flow. This section provides an overview of design principles for<br />
developing <strong>Domino</strong> applications and suggests ways in which you can apply these<br />
principles when you create <strong>Domino</strong> applications.<br />
13 of 217
Designing a <strong>Domino</strong> application begins with a business problem in backdrop of the<br />
requirement specification document generated through the requirement phase. Then<br />
work toward designing a solution that provides a positive user experience and maximizes<br />
productivity. The following are certain best practices of obtaining a quality design for<br />
<strong>Domino</strong> applications:<br />
A design demonstrates an architectural structure of the application to be developed.<br />
A design has to be modular such that the associated features are coupled as a single<br />
unit and logical distinct modules are created.<br />
A design demonstrates the inter dependency between the modules and the<br />
constraints, if any.<br />
A design describes data structure of the respective modules and the data flow<br />
between the modules.<br />
A design contains the details of interfaces (external and internal) with other systems<br />
to simplify the complexity of integration with other system.<br />
A designer aim of a flexible yet robust design structure for the application to easily<br />
adapt to the future improvements during the course of development and lifecycle of<br />
the application.<br />
A design describes the workflow process of the domino application and the details<br />
specific the workflow.<br />
A design contains the details of different roles and the access rights in different<br />
modules, and stages of workflow.<br />
A design describes any limitation, constraints, assumption, or special consideration<br />
about the application being developed.<br />
2.3.1 Design specification<br />
The design specification is no less than a bible for the application developer to create an<br />
application. The design specification translates the business requirements into the<br />
building blocks which would eventually bring life to the application. The design<br />
specification has cross references to the requirement document to indicate the<br />
application design that satisfies all the requirements. The design specification document<br />
should include the following sections:<br />
Graphic user interface (GUI) design<br />
Database design<br />
Module level design<br />
Workflow process<br />
Program specifications<br />
Security procedure design<br />
Detailed design document<br />
GUI design<br />
The graphic user interface (GUI) section describes the details about the GUI of the<br />
application such as screen layouts of different modules and their user interface<br />
description. It contains the details about the color themes, font settings, and formats for<br />
different components. This GUI design specification specifies the GUI standards to be<br />
adhered for the application development by the development team. The user accessibility<br />
features include the accelerator keys for action buttons and label fields. This section also<br />
should include the special GUI considerations if the multiple platforms portability is<br />
required, for example, mobile, web browser, and smart devices.<br />
When designing the GUI for <strong>Domino</strong> applications, consider the following:<br />
14 of 217
Always use the CSS or Themes to format the user interface and its layout. Avoid<br />
inline styles or markup text for formatting the screen layout and user interface<br />
elements.<br />
This would help implement standard look and feel for your application. It is also a<br />
good practice for application user interface maintainability. In case the user interface<br />
needs to be revamped, you only need to modify the CSS.<br />
Keep the user interface layout simple and uncluttered. If required, divide it into the<br />
logical sections, for example, navigation, actions, and application specific subsections.<br />
Avoid using pop-up unless really required to prevent errors caused by the pop-up<br />
blocker that does not allow the pop-ups to be launched. Instead, use the div layers to<br />
disable the main user interface screen and use the other div layer as top most with<br />
the fields and buttons to get the inputs as applicable.<br />
Avoid using the large size of images to mitigate problem that might caused by the<br />
disk space constraint (See 6.7_Graphics for details).<br />
Design your GUI with a focus on the target audience device screen resolution for web<br />
browser, handheld device, or smartphone.<br />
Either you set a standard for your application users that the application would be best<br />
viewed in particular screen resolution, or design the GUI to support few standard<br />
screen resolutions (for example, 800 x 600, 1024 x 768, or 1280 x 1024) for browsers<br />
and set similar standards for the smart devices. This standardization for screen<br />
resolution or screen size in your application helps to deliver standard GUI to the<br />
users.<br />
Database design<br />
This section describes the high-level overview of how the functionality and responsibilities<br />
of the modules are structured and integrated with the various modules. The detail of the<br />
module is not described in this section but only the overview the association among the<br />
modules. The main purpose of this section is to describe the general understanding of<br />
how and why the modules are separated, how the individual components work together<br />
as a unit to provide the desired functionality from the application.<br />
The description includes the major functionalities and the various capability of the<br />
application in terms of features to be provided. Describe the interrelationship between the<br />
different modules and the hierarchy of modules and sub-modules. This section mentions<br />
the basis of deciding the design points about the modules along with the approaches that<br />
have been rejected and the reasons. In this section, the high-level design model diagram<br />
for the application is included.<br />
Many <strong>Domino</strong> applications consist of a single nsf file. For more complex applications,<br />
there might be multiple nsf files which work together to make what appears to the end<br />
user to be a single application. At the database design stage, identify the number of<br />
databases required. Each separate database in the application should represent a logical<br />
entity. For example, the product development application of a manufacturing organization<br />
might have the following different databases:<br />
A master database to store all information related to the product, users, and other<br />
configuration parameters<br />
A product database to manage product development lifecycle<br />
An error log database to track various errors and background processes of<br />
application and so on.<br />
Below is a checklist (not exhaustive) of the factors that lead to the different databases<br />
required in a <strong>Domino</strong> application:<br />
15 of 217
Complexity of the business processes and interdependencies between the modules.<br />
If there seems to be a natural division of the data according to who will use it most<br />
and who will maintain it, and if the complexity of the interface between the different<br />
parts is low, that suggests separate databases migh make sense.<br />
If there are several smaller modules which are not inherently complex such as leave<br />
management, then a single database is sufficient for the effective functioning of the<br />
application.<br />
The potential number of documents and rate at which the database expected to<br />
grow. How many documents are "a lot" varies depending on your hardware and the<br />
number of users. But if you expect to be creating thousands of documents a month,<br />
you might consider having one or more archive databases, both for better<br />
performance and to make it easier for users to create local replicas of just<br />
relevant/recent content or search for just desired documents.<br />
If you think the application will contain a lot of large file attachments, consider a<br />
separate attachment repository. Attachments don't have a lot of effect on<br />
performance -- number of documents is a much more important factor than total disk<br />
space. But users may like to have local replicas, or you might like to create more<br />
server replicas, of just the document data, and have just a few server replicas of the<br />
attachments, if they are lesser used.<br />
The performance efficiency expected out of the application for data search and<br />
filtration. If the data search and filtration are some of the key drivers of application<br />
and database is expected to grow in number of documents and size, a suitable<br />
separation of databases should be considered in terms of central and local<br />
repositories. For example, the product development team from North America would<br />
deal with a database dedicated for that region and likewise a separate database for<br />
Europe and other locations.<br />
A centralized repository of all documents or truncated document in a common<br />
database for reporting and escalation purpose at global level. You might, for<br />
instance, have similar databases each used in a single country, but automatically<br />
copy an extract from each of these into a central reporting database.<br />
The target audience of the application. For example. if there are few modules to be<br />
accessed by third party, then such modules are to be hosted on secured access zone<br />
behind the firewall.<br />
The application expected to be hosted for third party internet users of the<br />
organization, For example, the partners and vendors. There are security concerns<br />
and legal restriction in terms of data access. A separate database with document<br />
available for third party access should be maintained in-line with the organization<br />
policy for data access.<br />
Other access considerations. If your application contains a significant number of<br />
documents that should be visible to one group of users but not to others, you can<br />
secure the documents with Readers fields, but this both has performance<br />
implications, and is complex to implement with certainty that it has been done<br />
correctly. By comparison, putting private documents into a separate database and<br />
using the database ACL to limit access, is simple to implement and simple to<br />
demonstrate as secure.<br />
Module level design<br />
This section describes the features and functionality details of the individual modules.<br />
The purpose of this section is to provide the primary functionality of the module. It details<br />
the further specifics to any constraints, design considerations, dependencies, interfaces<br />
incoming or outgoing, and exceptions to be managed. The data flow in the module in<br />
terms of input and output process of the module is described here. The use cases<br />
16 of 217
specific for the individual modules is also defined here.<br />
When working on the module level design for <strong>Domino</strong> application, consider the following:<br />
Try to limit the number of views. Too many and too complex views, is the most<br />
common factor limiting application performance.<br />
Try for a balance between the number of forms, and the complexity of each form. It<br />
takes a certain amount of experience in <strong>Domino</strong> development to get a feel for what<br />
makes sense to go together in a single document. If two document types are very<br />
similar, you can consider combining them. If a single form is huge and contains<br />
dozens of hide formulas, optional sections, and hundreds of fields, chances are<br />
you're trying to do too much with a single form, and should consider a main<br />
document and responses instead.<br />
Make use of common functions and reusable script libraries to provide the interfaces<br />
between the modules.<br />
Avoid duplicating the data across modules.<br />
For example, in a product development application, product related information and<br />
the related process to maintain it are better managed in one module and the<br />
reference view lookup or back-end script should be used to integrate the product<br />
data in the other modules. However, there are tradeoffs here. If you have another<br />
application store only the product ID when it refers to a product, then whenever users<br />
use that form, either they only see the product ID and have to click on something to<br />
find out what product it represents, or the application has to do a live lookup with the<br />
product ID as key, to display the product name and other information. There's nothing<br />
wrong with that, but it has limitations: the looked-up data are not available for use in<br />
views, and if there are too many lookups on a single form, performance may be<br />
unacceptable. Therefore, you may occasionally need to duplicate data, but consider<br />
whether there is a need and how aggressively you have to keep the data up to date.<br />
Use shared code, sub-forms, shared columns, and shared actions to achieve<br />
reusability of similar features across modules. However, do not overdo the use of<br />
shared code component because there is a runtime overhead for <strong>Domino</strong> to link the<br />
shared items with other items for final rendering. A few simple rules:<br />
o Use shared code components if the items could be used at more than one<br />
design element or modules.<br />
o Benefit of maintainability is more compared to the marginal overhead for the<br />
<strong>Domino</strong> to link the shared components.<br />
Workflow process<br />
Notes/<strong>Domino</strong> doesn't contain any specific feature called "workflow." Workflow is<br />
something you do with the product as part of your application design. There are,<br />
however, features in the product that are helpful in implementing your own workflow<br />
process from scratch. There are also add-on products available to assist you in<br />
implementing workflow in Notes, including:<br />
<strong>Lotus</strong> Workflow, a product offering from <strong>IBM</strong>.<br />
Various third-party products.<br />
At least one free workflow framework on openntf.org.<br />
The domino application portfolio for an organization may include many applications that<br />
are workflow enabled. Building the workflow capabilities in <strong>Domino</strong> application can take<br />
considerable effort depending on the complexity of the workflow. If you do create your<br />
own workflow, design reusable components that can save you time in making the<br />
workflow functions available on all forms. Ideally you can reuse your workflow<br />
components in other <strong>Domino</strong> applications.<br />
17 of 217
The following features of <strong>Domino</strong> are useful in building workflow into your applications:<br />
Reader and Author fields to control access to a document at different stages of its<br />
lifecycle.<br />
Electronic signatures in "signed sections" to prevent forged approvals.<br />
Scheduled agents to provide email reminders of overdue workflow steps.<br />
Hide formulas and controlled access sections to limit who can view or edit different<br />
parts of a document, depending on its workflow state.<br />
Document locking, to prevent replication/save conflicts during workflows which<br />
include parallelism or where there are multiple possible approvers at a given step.<br />
To design a workflow capability that is easy to maintain with high rate of re-usability using<br />
<strong>Domino</strong> Designer, consider the following:<br />
Design a workflow engine instead of hard-code all the workflow rules spread across<br />
the application design.<br />
This approach helps the development team in efficient maintenance of the workflow<br />
process of the application and its scalability. Making the workflow process of <strong>Domino</strong><br />
application configurable gives flexibility to reuse it in several applications.<br />
The workflow engine should have three major components:<br />
o Workflow configuration documents:<br />
This is used to deal with the different phases, steps, activities or status of the<br />
workflow and associated details. Each workflow configuration entry stores<br />
the following details:<br />
• Each workflow configuration document has configuration key or ID.<br />
• Module name to which this configuration is associated.<br />
• Name of the field in document to identify the current actors (to<br />
populate Authors) and spectators ( to populate Readers) by the<br />
workflow engine.<br />
• Store the next workflow configuration key in case of approval or<br />
rejection of the current stage. This attribute help workflow engine<br />
define the document routing sequence.<br />
• The mail subject and body in case of approval or rejection email<br />
requirement.<br />
• The name of field in form/document to identify the names to send<br />
workflow emails<br />
• Several other mechanisms to be considered in workflow<br />
configuration, is it parallel or sequential workflow or it’s a mix.<br />
o Workflow engine script library:<br />
The library is used to read the workflow configuration parameters defined in<br />
workflow master and act on the document as appropriate depend on current<br />
stage of the document triggered by users action.<br />
o Workflow user interface components:<br />
This are the workflow actions to trigger the workflow step with reference to<br />
the respective workflow configuration.<br />
Program specifications<br />
Program specifications should include the details of the GUI design, database design,<br />
module design, and workflow process. In the program specification, detail out the<br />
different possible <strong>Domino</strong> design elements required for various purposes that are input<br />
(Forms), output (Views and Forms), data storage (Documents), and Data manipulation<br />
programs (agent, script library, actions, events, and others). The program specification is<br />
the instruction for the developer to design and build business logic into the application.<br />
The input description includes the navigation, layout, input transaction, data editing rules,<br />
18 of 217
data validations, messages and general input processing. The output description includes<br />
the layout, panels, reports, screen output, messages and general processing. The data<br />
storage structure deals with the different fields, its data type, the access to data, data<br />
calculation or update rules. The data manipulation programs describes about the<br />
business logic for creation, update, and deletion of data, workflow processing rules,<br />
business logic, dependency of modules, and other components.<br />
Security procedure design<br />
<strong>Domino</strong> is known for its granular level security control. Every single detail about the<br />
application security features to be considered, right from the database access control list<br />
to the documents, sections, and fields, the level of different access the business actor<br />
has on the database, and access rights of other system on this application are also<br />
documented in the program specification section. The following features provide a high<br />
level of security against unauthorized viewing and editing of documents:<br />
Database ACL<br />
Document Readers fields<br />
Document Authors fields (for users with Author access to the database - Authors<br />
fields are irrelevant for Editors and higher)<br />
Encryption (to hide individual fields)<br />
Electronic signatures (which don't prevent editing, but make unauthorized editing<br />
easy to detect).<br />
The $UpdatedBy and $Revisions items of documents, which make it impossible to<br />
modify a document without any trace.<br />
There are also several Notes/<strong>Domino</strong> features which resemble security features in that<br />
they hide data from casual users, but are not secure from a "power user," particularly if<br />
they have a copy of <strong>Domino</strong> Designer. It's not wrong to use these features; you just<br />
need to be aware that if you need a higher level of security, they aren't sufficient on<br />
their own. A few of these features are:<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Hide-when formula<br />
Restricted category option in view URL, or restrict to category in an embedded view<br />
in the Notes client<br />
Restriction on document viewing or editing using JavaScript onload() redirection in<br />
a web application.<br />
Restriction on document viewing or editing in the Notes client by means of form<br />
events, e.g. Queryopen.<br />
Restricted access to views<br />
Different type of computed fields<br />
Other DHTML features of styling the visibility or editing features of fields and<br />
sections<br />
As a general rule, if a user technically has access to view or edit a document or field, and<br />
they are sufficiently skilled, they can find a way to do so, through writing code that<br />
bypasses your UI or often by other, simpler means. If your application demands the<br />
highest levels of security, you must use the features in the first list.<br />
To design security procedures for <strong>Domino</strong> application, consider the following:<br />
<br />
<br />
Avoid using the anonymous access to database unless it is required.<br />
Avoid adding individual user and server names to the database ACL. It makes<br />
maintenance of application access difficult. Instead, use groups to simplify the ACL<br />
entries.<br />
19 of 217
There is a limitation of about 75 roles supported through database ACL. Consider<br />
using ACL roles for security implementation only if the roles are expected to remain<br />
within the limit during the life of the application.<br />
For example, using role such as country names to grant access to the users of<br />
respective country in a global application would lead to a situation of limitation. Use<br />
different groups for country or replica copies instead of role implementation.<br />
Roles are generally best used to control access based on a user's tasks within the<br />
application; for instance, there might be a "CostApprover" role with authority to<br />
perform a given workflow approval.<br />
Grant Editor and high level access in database only to the required users.<br />
Use Author and Reader level access to enforce the document edit and read access<br />
to the authorized user of the application. Readers fields have performance impact in<br />
views, which is detailed elsewhere in this wiki.<br />
Detailed design document<br />
On the basis of the design elements identified in the program specification, the detail<br />
design document must be prepared. This activity is a drill down version of program<br />
specification wherein every detail of each field in the form, each column in a view, each<br />
action button, hides-when formula, every event, agents, script library, function, every<br />
small detail about the application development are mentioned.<br />
2.3.2 Prototyping<br />
Prototyping is the concept wherein subset model of the application attempts to simulate<br />
only a very few features of the final application. Prototypes are aimed to get feedback at<br />
early stage from the user about the critical aspects of the application. The prototype is<br />
also used to generate a proof of concept in case the application feature deals with either<br />
new technology or methodology and likewise. Prototyping techniques are used for early<br />
validation of operational concepts and user interface. It is also used when the user are not<br />
sure about how to implement a certain set of features. It also helps to validate the<br />
feasibility of a solution. <strong>Domino</strong> Designer, being a Rapid Application <strong>Development</strong> tool, is<br />
fast and facilitates rapid iteration between prototypes.<br />
2.3.3 Test planning<br />
Test planning identifies the business requirements for which the system is developed and<br />
also specifies the application development aspect. It identifies activities, dependencies,<br />
and effort required to achieve the test objectives. The test planning adopted is based on<br />
the risks involved in order to make optimal utilization of test efforts. A manual testing of<br />
<strong>Domino</strong> application is guided through the test case document prepared. The test cases<br />
are the business scenarios for which the developed application must be tested against.<br />
The test plan describes how the testing will be implemented. It should state what will be<br />
tested, the major actions taken while testing, test techniques that will be used, the extent<br />
or depth of the test, and how the results will be verified. This approach shall ensure that<br />
the requirements are adequately tested.<br />
The criteria for testing has to be well defined. It states the criteria for accepting and<br />
rejecting the test results. In case of unit testing, the code review should be completed and<br />
the associated defects detected in the code review cycle should be fixed. The entry<br />
criteria for integration testing should be the unit tested code, with the defects detected in<br />
20 of 217
the unit testing phase fixed. In case of systems testing, the code should have completed<br />
the Integration testing cycle, with the defects detected in the Integration testing phase<br />
fixed.<br />
The application module tested may require another testing cycle if the variance between<br />
the planned and the actual number of defects detected in the testing process is<br />
considerable or a major defect is encountered during the testing process.<br />
It is crucial to plan to test the application with a realistic number of sample documents. It's<br />
very common for Notes/<strong>Domino</strong> applications to work fine in testing when using one<br />
workstation with a few dozen documents, but when they're in actual use with tens of<br />
thousands of documents and hundreds of users per server, performance bogs down. It's<br />
also a good idea to have a realistic number of (automated) test users for performance<br />
verification.<br />
2.3.4 Design authorization<br />
The design authorization is an important step to obtain a buy-in from all the stake<br />
holders. The initial design authorization is done within the hierarchy of the development<br />
team. This final internal review of the design is done before it is presented for customer<br />
sign-off.<br />
2.4. <strong>Development</strong><br />
In this section we have a look at how you can fine-tune your coding and development<br />
process to optimize your application development and its performance.<br />
2.4.1 Coding practices<br />
<strong>Best</strong> coding practices for software development can be broken into many levels based on<br />
the coding language, the platform, the target environment, and so on. Using best<br />
practices for a given situation (in our case <strong>Domino</strong> and XPages) reduces the probability<br />
of introducing errors into your applications, regardless of which software development<br />
lifecycle (SDLC) model is being used to create that application. In a team environment,<br />
best coding practices ensure the use of standards and uniform coding, reducing oversight<br />
errors and the time spent in code review.<br />
Some of the best coding practices that you can use are:<br />
Use a uniform standard and naming convention across all the code.<br />
Have code reviews involving multiple developers.<br />
Unit test all code.<br />
Have proper documentation, including generous amounts of code comments.<br />
Use script libraries to prevent duplication of functions, constants such as view and<br />
item names, and common datatypes and enumerations.<br />
If you write <strong>Lotus</strong>Script or JavaScript, use object-oriented coding techniques.<br />
Avoid goto statements and overly deep levels of nesting.<br />
Limit modules to a reasonable length; generally not more than 60 lines.<br />
Simplify and optimize your code as much as possible.<br />
Remove unnecessary code before deploying.<br />
21 of 217
If you write <strong>Lotus</strong>Script, use Option Declare, which cuts your initial coding errors by<br />
half. There's an option in the editor which automatically inserts this statement for you.<br />
For general coding best practices, we recommend doing some reading on the subject, for<br />
instance in such works as The Elements of Programming Style by Brian W. Kernighan<br />
and P. J. Plauger.<br />
We discuss more about XPages development best practices in 4.6 Optimizing XPages<br />
using custom control.<br />
2.4.2 Version management<br />
For an effective tracking and proper maintenance of your code, you should use a version<br />
management system for your applications. In <strong>Lotus</strong> <strong>Domino</strong> Designer 8.5.3, a new<br />
source control feature has been provided which helps you to do version management out<br />
of the box without using the external plugin that you had to use earlier. This feature has<br />
been introduced to let you store NSF based design elements into a source control<br />
repository and perform common source control operations using <strong>Lotus</strong> <strong>Domino</strong> Designer.<br />
Using this feature, you can create an association between an on-disk project managed by<br />
the source control and the virtual NSF based project that your Designer recognizes and<br />
tracks.<br />
To use this feature, follow these steps:<br />
1. Install and configure the open-source version source control systems and create<br />
and configure a repository.<br />
2. Associate your application (NSF) with an on-disk project (ODP) or create a new<br />
one.<br />
3. Commit your changes from Designer on-disk project to the repository.<br />
4. Ask your team to retrieve on-disk project from the repository and associate their<br />
databases with the on-disk project.<br />
22 of 217
5. Modify either NSF or on-disk project (ODP) and synchronize the two files.<br />
6. Commit changes to repository and ask other team members to download and<br />
sync their local files.<br />
2.4.3 Unit testing<br />
Unit test is the first and most important level of testing in the software development<br />
lifecycle. It is usually done by the programmer, and it is their responsibility to make sure<br />
that their piece of code passes through without any errors and is compatible with the rest<br />
of the application. You can save a lot of effort and resources in the long run if all the<br />
programmers in your team do their quota of unit testing thoroughly.<br />
In order to make the unit testing effective, first of all, make sure that it is followed<br />
rigorously by all the team members and have and allot sufficient time for them to test.<br />
You can refer to this link for details on what, why and how of unit testing<br />
23 of 217
2.5. Test<br />
http://en.wikipedia.org/wiki/Unit_testing.<br />
The <strong>Domino</strong> open source website, OpenNTF.org, contains multiple projects with free<br />
tools to assist in unit testing of Notes and XPages applications.<br />
The test phase ensures that the planned tests are executed to ensure the quality of the<br />
application developed. It includes setting up the test environment and test data. The test<br />
setup should simulate the real environment of the business as close as possible. The<br />
scope of testing would be limited to the test planning and test cases prepared. The test<br />
environment should have all the dependant system and interfaces configured for proper<br />
testing. The testing phase is bound to be conducted in an iterative form where any defect<br />
observed during testing must be fixed and re-tested again.<br />
The <strong>Domino</strong> application test setup includes several aspects:<br />
Setting up the test server configured in line with the production and pre-production<br />
servers for better simulation of test scenarios.<br />
Creating multiple test user IDs on server to test application for different set of users<br />
with varied access rights.<br />
Setting up of an appropriate database access control list (ACL) as per the design<br />
specifications to ensure each test user ID has an appropriate access rights. Avoid<br />
using the higher access in database ACL for any test user ID that does not match the<br />
user role defined in the design specification.<br />
Deployment considerations: If the <strong>Domino</strong> application is to be ported to several<br />
platforms, for example, multiple version and types of browser, mobile and smart<br />
devices, an appropriate test setup should consider all these factors and the test<br />
environments should be made available for testing.<br />
Internationalization considerations: If the <strong>Domino</strong> application is to be deployed at a<br />
global level, providing multiple servers with different time zone and regional settings<br />
is another key factor of setting up the test environment to simulate the real life<br />
environment.<br />
2.5.1 Application testing<br />
This phase consists of unit, integration, and system tests. All the modules are tested<br />
individually and then integrated for the system testing in successive cycles. The defects<br />
found in a cycle of testing are fixed before commencing the next cycle of testing. The<br />
systems testing is also carried out as part of this phase. There should be no open issue<br />
which is critical for the user acceptance the application. The application is not handed<br />
over for user acceptance test (UAT). Unless all the issues reported during the application<br />
testing are not fixed, verified, and closed.<br />
The key aspects of the applications test are:<br />
<br />
<br />
Conformance to business requirements:<br />
This aspect of application test is focused towards to ensure the application developed<br />
meets all the business requirements. The requirement in terms of GUI, business use<br />
cases, business rules, and all type of business related processing expected from final<br />
application. Verify the features and the functioning of them as per the requirements<br />
and design specifications.<br />
Process workflow and application security:<br />
24 of 217
The important aspect of most of the domino applications is its workflow and security<br />
implementation. This being a core of any domino application, a special attention is<br />
required in this area including the workflow routing of the document and mail routing<br />
associated with it and the security implementation in terms of authors, readers,<br />
controlled section, and data security at different levels of workflow. The workflow<br />
must be tested with test user IDs having appropriate access to simulate the business<br />
environment.<br />
<br />
<br />
<br />
Application performance test<br />
<strong>Domino</strong> applications are expected to be tested for the performance. It encompasses<br />
several aspects of performance testing of an application: the response time, screen<br />
loading, form submission, the processing efficiency of various features, and overall<br />
performance with peak load of concurrent user using the application.<br />
Multi-browser compatibility test<br />
Consider the browser standards of the target business organization for <strong>Domino</strong><br />
applications. In genera, business offers the application compatibility to one or few of<br />
the popular browsers. The application has to be tested for compatibility and<br />
awareness of the types of browser that offered. Perform the proper test of each<br />
browser enabled feature on the target browsers to ensure the application<br />
compatibility for the same.<br />
Multi-language or regional setting test<br />
<strong>Domino</strong> applications must be tested as per the various target user’s regional settings<br />
to ensure better adaptability. The scenario wherein the application hosted on a<br />
<strong>Domino</strong> server that has a different regional setting as that of the users using the<br />
application should be established. A specific consideration must be made to test the<br />
date, time, and number type data fields for the formats, calculation, and presentation.<br />
The test is also required to understand the different character set to be managed for<br />
any data input and output processes for the application.<br />
The <strong>Domino</strong> application testing is one of the key phases in the <strong>Domino</strong> application<br />
development life-cycle. The following are some of the guidelines to test the <strong>Domino</strong><br />
application.<br />
GUI<br />
The GUI of the <strong>Domino</strong> application should be tested for its consistency in screen layout,<br />
font formatting, and color scheme as per the design specifications or the GUI standards<br />
defined during the design phase. Test the GUI screen of a view as well as of forms with a<br />
possible data in the <strong>Lotus</strong> Notes document with inline HTML or mark-up text entered by<br />
the users in one of the field. The system should either render such inline mark-up text<br />
without disturbing the application GUI or validate such data entry with appropriate<br />
restrictions.<br />
Data caching<br />
Test the <strong>Domino</strong> application for a consistent, recent data presentation on screen for<br />
dynamic contents. Post a <strong>Lotus</strong> document with data content from browser to <strong>Domino</strong><br />
server and re-open this document in read mode in browser. Verify that the last modified<br />
data, not the cached data, is display on the screen for the document. Irrespective of the<br />
browser setting for cache, the <strong>Domino</strong> application screens that deals with the dynamic<br />
data should be tested for no cache data implementation.<br />
Data views<br />
Test all the user interface views of the <strong>Domino</strong> application for the number and the<br />
sequence of columns required as per the design specification. You should also test the<br />
25 of 217
views for other aspects such as view navigation or pagination, column sorting, default<br />
view sorting, document listing, empty categories (in case of categorized views), view<br />
actions, and view filtration. Test the view data access, log in to the <strong>Domino</strong> Application<br />
using different user access rights or user IDs and test for restricted document level<br />
access. Test the response time of the navigation across pages for the views to make<br />
sure it meets the requirement. The view level actions should be tested based on the<br />
features enabled for the <strong>Domino</strong> application. Such as the in-view document edit option,<br />
processing of the selected documents, and any other specific view actions must be<br />
appropriately tested with reference to the design specifications. The new documents<br />
created in the database which qualify to be listed in a particular view should be tested for<br />
appropriate listing of the newly created document in the view to verify the view index is<br />
automatically refreshed. If the document contents are expected to have multi-lingual data<br />
which includes accented characters, test the view column sorting for accent sensitive<br />
sorting.<br />
Data access, edit, and search<br />
Test the data manipulation features of the <strong>Domino</strong> applications for data validation, data<br />
consistency, data constraints, and business rules expected as defined in the design<br />
phase. The data accessible through a form in different sections as well as the fields and<br />
actions expected to be visible or actionable to the users with different access levels must<br />
be tested as per business rules defined for the application. For thorough testing, prepare<br />
an access control matrix for each type or level of access rights and roles against each<br />
and every user interface action and data presentation layer. Prepare such matrix in line<br />
with the design specifications and the business rules defined during the design phase.<br />
This approach would ensure that data access, in terms of visibility and editing, is tested<br />
appropriately without missing any particular combination of access levels expected from<br />
the application.<br />
The data search capabilities provided in the <strong>Domino</strong> applications must be tested on the<br />
following parameters: the data fetch response time, the data search accuracy, and the<br />
data security. During the test environment preparation, generate the kind and the amount<br />
of test data as it is expected in the production environment. Work with the business users<br />
to obtain this data to simulate the proper data search test scenarios. Avoiding this test<br />
could result in a number of blocking issues during the user acceptance test (UAT).<br />
Generally, in the UAT phase, the business user would use the actual data from the<br />
business to validate the user acceptance of the application. Hence, at this stage of<br />
application testing, it is critical to not only test the application features but also use the<br />
business data to simulate the actual business environment. This approach would help<br />
identify applications acceptability in terms of handling different type and set of data<br />
content expected to be used during production run of the application, for example, the<br />
amount of data to be managed by the application considering the initial production run<br />
and the data size growth expected during the applications production life-cycle.<br />
The UAT incudes testing the applications response time and efficiency in data search<br />
capabilities of the application. Verify the performance requirements defined by the<br />
business or the design team in design phase is met with the data search response time<br />
parameters in the performance benchmark. In addition to the response time, the data<br />
search accuracy test is equally important in UAT. If the full text search feature is<br />
implemented to gain performance efficiency on data search response time, it has its own<br />
set of inherent flexibility which might not be acceptable from data search accuracy point<br />
of view. For example, the search action triggered (using full text search) for searching<br />
text "Belgium" would fetch the document field contains "Belgium" as well as "Kingdom of<br />
Belgium". This might not be the result the business users expect. It is important to<br />
understand the expectation of the business for such scenario, wherein whether the<br />
business needs the exact match or word match.<br />
26 of 217
Background agents<br />
<strong>Domino</strong> applications implement <strong>Lotus</strong> script and Java agents that have to be tested to<br />
verify the expected functionality defined in design specification. Test the background<br />
agents for the appropriate access rights for the business requirements. Generally, a<br />
background agent is run using the access rights as that of the agent signer. However, in<br />
many <strong>Domino</strong> applications, it is required that the agents to be run as web user to allow<br />
the agents to execute with access rights of the current session user. For example, the<br />
WebQuerySave agent that triggers email or performs certain activities that require the<br />
current session user context are configured to run as web user. If this perspective is<br />
missed during the application testing, it leads to failure in certain business use cases<br />
during UAT. This is one of the important aspects to ensure the agent is tested<br />
appropriately either in context of agent signer or the current session user as per design<br />
specifications. Similarly, depend on the application requirement, the proper functioning of<br />
the restricted actions by the background agent must be tested, for example, the proper<br />
functioning of the background agents that handle file system operations.<br />
Other business scenario for background agents is where an agent attempts to access<br />
database on another server in the same domain. The common <strong>Domino</strong> server<br />
administration policy is to disable the access of any background agent triggered from the<br />
<strong>Domino</strong> server to access resources on another <strong>Domino</strong> server where the two servers are<br />
not explicitly trusted even in the same domain. The solution that considers the<br />
background agent accessing resources across servers should be done at earliest during<br />
the application development lifecycle. The design phase is an appropriate stage to make<br />
such consideration. The <strong>Domino</strong> application test has to consider this aspect and to check<br />
any possible issues arising due to the infrastructure setup constraints or the solution<br />
implemented. The best approach is to check the possibility with the administration team<br />
if, within the organization policy, the trusting of server in same domain is possible to allow<br />
this solution to function properly. The alternate solution is to create a replica of the other<br />
database on the source server to ensure the dependant database is available on the<br />
same server.<br />
The background agent performance must be tested within the context of the real<br />
business scenario. Certain <strong>Domino</strong> server configurations settings have an impact on the<br />
time allocated for any background agent process of <strong>Domino</strong> application to complete its<br />
run on the respective <strong>Domino</strong> server. The <strong>Domino</strong> application background agents must<br />
be tested for its performance efficiency to comply with the configuration settings of the<br />
target production server.<br />
Following are some of the key server configuration settings for a background process of<br />
<strong>Domino</strong> application:<br />
<br />
Max <strong>Lotus</strong>Script/Java execution time:<br />
o This configuration parameter (see the figure below) in Agent Manager tab<br />
has two possible values in context of daytime and nighttime parameters. The<br />
agents run during each period are subject to the settings in the parameter<br />
fields for that period.<br />
o Agent Manager is a server task that is responsible to manage the schedule<br />
and background agents run on server.<br />
o This parameter specifies the maximum minutes a <strong>Lotus</strong> Script or Java agent<br />
has to complete execution during that part of the day. If the agent<br />
exceeds this maximum execution time, the job won't be finished, and the<br />
Agent Log records the termination.<br />
o Defaults are 10 minutes for daytime and 15 minutes for nighttime. <strong>Domino</strong><br />
administrator can increase the execution time limits to allow the complex<br />
agents sufficient time to complete. Setting the value of this field excessively<br />
27 of 217
o<br />
high might impact system performance, because the Agent Manager runs for<br />
a longer time to accommodate the agent.<br />
This time limit setting prevents erroneous agent processing that take<br />
unusually long execution time from occupying the resource.<br />
<br />
Web agent and web services timeout:<br />
o The web agent or web services in context of this parameter (see the figure<br />
below) is the agent and web service that is triggered by the browser clients.<br />
This include application agents invoked by the WebQueryOpen and<br />
WebQuerySave form events and for the agents invoked by the URL<br />
command OpenAgent.<br />
o This setting allows the administrator to manage the execution time limit for<br />
web application agents. The purpose of the time limit is to prevent web<br />
agents from running indefinitely and using server resources. This parameter<br />
specifies how the maximum number of seconds a web agent or web services<br />
has to complete its execution.<br />
28 of 217
2.5.2 User acceptance testing<br />
This phase consists of acceptance testing by the customer. <strong>Development</strong> team must fix<br />
defects found during this period by the users. In addition, the development team has to<br />
continue to test the product and improve quality. The acceptance test has to be<br />
performed for all deliveries and releases.<br />
2.6. Deployment<br />
The <strong>Domino</strong> application deployment procedure varies among the organizations. In this<br />
section, we discuss the some of the best practices pertaining to the <strong>Domino</strong> application<br />
deployment in an enterprise. Application deployment is planned and scheduled as part of<br />
the project planning. The stakeholders (business owner of the application, application<br />
development team, and <strong>Domino</strong> administration team) make the decision of deployment<br />
date and action required for successful deployment. Decisions include the planned<br />
downtime if required, packaging template (.NTF) for moving to production, and a detail<br />
activity plan. The <strong>Domino</strong> application is eligible for deployment only after the positive<br />
sign-off received for the application in user acceptance testing (UAT) phase. In the<br />
majority cases, the responsibility of application deployment to production is with the <strong>Lotus</strong><br />
<strong>Domino</strong> Administration deployment team.<br />
Deploying new release<br />
When deploy a new release of an existing application on the <strong>Domino</strong> production server,<br />
consider the following tasks:<br />
<br />
<br />
<br />
<br />
<br />
The application level downtime is required.<br />
o Application business owner plans for the application level downtime that<br />
is suitable for all the stakeholders, For example, the deployment could be<br />
schedule on non-business working days or time to have lesser impact (it<br />
is the best for a complex deployment which runs into several hours).<br />
o Inform the impacted users through email about the application downtime<br />
at least a week in advance to allow the business users to plan their<br />
activities accordingly. It is a good practice to send a reminder a day<br />
before the scheduled deployment.<br />
System administration team plans for proper backup of production copy of the<br />
impacted <strong>Domino</strong> application databases with data.<br />
o The deployment should prepare a rollback plan (if required consult with<br />
the development team for inputs)<br />
<strong>Domino</strong> administrator identifies the template for deployment from the UAT<br />
environment that have received positive sign-off by the user.<br />
o This template is to be used for design refresh or replace on the<br />
production database as part of the deployment activity.<br />
<strong>Development</strong> team prepares deployment related activities including required data<br />
updates on the existing documents, configuration creation , required batch<br />
processing of documents, deployment verification, and so on.<br />
On the day of deployment, <strong>Domino</strong> administrator perform the following activities:<br />
o Revoke the access right of the general users from the impacted<br />
database[s].<br />
o If the domino application has several replicas across servers, disable the<br />
replication temporarily on the hub replica for deployment activities. It<br />
helps to avoid any replication conflicts and database inconsistency while<br />
deployment process is initiated.<br />
29 of 217
o Refresh or replace the production database with the final template<br />
(.NTF).<br />
o Check for any errors with reference to the design refresh or replace<br />
action.<br />
o Update the view indexes and recompile all the scripts.<br />
o Perform any change in ACL if required, for example, add, edit, or remove<br />
roles, ACL entries, and ACL privileges.<br />
<strong>Development</strong> team performs deployment actions on the application databases.<br />
For example, perform batch update of existing document (add or remove of<br />
fields, or change in key field value), create or update application configuration.<br />
<strong>Development</strong> team verifies the deployment by making observation of key<br />
features and screen as expected.<br />
Have the user representation for the critical application deployment to ensure<br />
timely identification of any issues before the application is made available for<br />
general usage.<br />
Upon the successful completion, perform the following actions:<br />
o <strong>Domino</strong> administrator re-opens replication of the application on hub<br />
server.<br />
o <strong>Domino</strong> administrator restores database access to both existing and new<br />
users.<br />
o Application business owner sends an acknowledgement email to the<br />
impacted users about the successful deployment.<br />
In event of failure of the deployment activity, <strong>Domino</strong> administrator invokes the<br />
rollback procedure to restore the backup on production. Share the failure report<br />
to the stakeholders.<br />
Deploying a new application<br />
For a new application, the application level downtime is not be required. The deployment<br />
tasks include:<br />
Creating the NSF files for the application from the template file from UAT.<br />
Setting up the access control lists for the NSF files.<br />
Replicating the NSF files to a <strong>Domino</strong> server, or e-mail them to somebody who has<br />
the permission required to do so.<br />
Setting up any data in documents that the application code required to function<br />
properly.<br />
Application business owner sends an acknowledgement email about the launch of<br />
new application.<br />
Deploying a minor fix<br />
When deploying a minor fix, the application level downtime might not be required. The<br />
deployment process is simple:<br />
<br />
<br />
Consider the criticality and complexity of the application and back up the databases<br />
as the rollback plan. You can use the daily regular backup copy if available.<br />
<strong>Domino</strong> administrator simply refreshes the design of the impacted databases.<br />
30 of 217
2.7. Production<br />
In today's <strong>Domino</strong> environments, the number and the complexity of <strong>Domino</strong> applications<br />
are increasing due to growing demands and due to the rapid and easy-to-use application<br />
development technologies provided by the <strong>Domino</strong> Designer that facilitate more<br />
developers to build applications and to deploy them to an existing infrastructure. In an<br />
<strong>IBM</strong> <strong>Domino</strong> environment with a large number of applications, one of the main question is<br />
how to support this environment so that all involved parties can work efficiently. In this<br />
section, through explaining an application hosting framework, we guide developers,<br />
administrators, and database owners for improving services so that an environment can<br />
scale from a small to a very large deployment while increasing functionality, the level of<br />
automation, and customer satisfaction. We also provide the <strong>Domino</strong> clients guidance to<br />
avoid problems before they occur.<br />
Our discussion about <strong>Domino</strong> application development life-cycle in the previous sections<br />
covers the following items<br />
<br />
<br />
<br />
Quality control for applications that are being developed or being extended.<br />
Standards or design guidelines for <strong>Domino</strong> applications.<br />
Interaction and communication between application owner, application developer,<br />
and administrators of the environment.<br />
For production environments, including <strong>Domino</strong> environments, issues might be raised<br />
include:<br />
<br />
<br />
<br />
Resources required by existing applications are growing over time due to more users<br />
or more data within them.<br />
Operational costs of an application are not identifiable<br />
Application life-cycle is not supported, not controlled or verified, and not automated.<br />
Due to these issues, a number of effects might be the result for the operation of an<br />
environment, which for example, has an impact on user satisfaction or the total cost of<br />
ownership of the environment:<br />
<br />
<br />
<br />
<br />
<br />
<br />
Unable to plan infrastructure resources such as CPU, storage, and memory<br />
consumption up front.<br />
Wasting resources on inefficient applications while others would need them.<br />
A large variety of custom developed applications due to missing implementation or<br />
release processes.<br />
Critical applications did not get the resources needed.<br />
Troubleshooting and ad hoc actions become more and more a priority for operators<br />
to face low performing applications.<br />
Simple and efficient applications have to share the costs with the heavy and complex<br />
applications that did not use best practices at design time.<br />
Based on the as-is situation described above, the goal of this framework is to significantly<br />
improve user efficiency with the following items:<br />
<br />
Improving serviceability by clearly separating interfaces, processes, and services<br />
31 of 217
Having clear guidelines for all participating parties within the life cycle of an<br />
application by using properly defined standards for server infrastructure and<br />
applications<br />
Avoiding application issues (which is equivalent to improve reliability) by proactively<br />
planning resources and by continuously reviewing existing applications<br />
More transparent billing process by classification of applications into categories<br />
While the technical aspects of operating <strong>Domino</strong> servers has been covered already in the<br />
<strong>IBM</strong> Redbooks wiki Optimizing <strong>Domino</strong> Administration, this document focus on the<br />
application management process in a production <strong>Domino</strong> environment:<br />
<br />
<br />
2.7.1 Application management strategy<br />
2.7.2 Application management process<br />
2.7.1 Application management strategy<br />
An application management strategy describes an high level approach about how to<br />
handle <strong>Domino</strong> applications within an organization. It is more a concept that can be<br />
extended from small implementations to large scale enterprises rather than a fixed set of<br />
settings and properties. The application management strategy items described in here<br />
are supposed to define the steady state operation for a <strong>Lotus</strong> <strong>Domino</strong> environment with a<br />
clear goal to improve service quality and process efficiency.<br />
Let’s start by clarifying the different services and standards which apply to a production<br />
environment.<br />
Infrastructure services<br />
Infrastructure services describe the components which are required to operate a <strong>Domino</strong><br />
server regardless of its applications. Those services are to be in place before one can<br />
start putting production applications on a server.<br />
<br />
<br />
<br />
<br />
<br />
<br />
Installation of a <strong>Domino</strong> servers and additional resources:<br />
If required, the infrastructure team is requested to install additional servers according<br />
to predefined standards (CPU, RAM, HDDs, and so on).<br />
Defining server categories (small/medium/large) and assigning a specific hardware<br />
configuration for each type is helpful here.<br />
Monitoring of <strong>Domino</strong> servers:<br />
Continuous monitoring of running server tasks and server load. Monitoring includes<br />
taking care of CPU, memory, and disk utilization.<br />
Service level reporting:<br />
Reporting of service levels on a per server basis. If needed, those can be reported for<br />
each class of applications.<br />
Backup and recovery:<br />
Continuous backup of application data with defined retention periods according to a<br />
defined backup plan. Recovery of complete servers or individual applications after a<br />
crash or data loss according to defined procedures.<br />
Virus scanning<br />
Regular scanning of application data for viruses including definition about how to<br />
handle applications which contain harmful code.<br />
Troubleshooting<br />
In case of a problem, identify the root cause and take actions to return to steady state<br />
32 of 217
operation as soon as possible.<br />
Analyze the server outages and error messages generated from server crashes.<br />
In order to establish these infrastructure services standards and service levels, a clear<br />
description of each element shall be agreed between the involved parties.<br />
Application services<br />
Application services describe the most important services required for operating<br />
applications on a <strong>Domino</strong> server. Those services are typically provided by an application<br />
development or application support team in close cooperation with the administration<br />
team.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Maintain an application repository:<br />
Such a repository is a list of <strong>Domino</strong> applications with its metadata such as<br />
application owner, file name, replicaID, ACL information, operational requirements,<br />
expiration date.<br />
This repository should also contain a classification of the application. Key element is<br />
to assign an owner for each application, which can be contacted at a later stage, for<br />
example, in case of questions about access rights to the application.<br />
Rollout of applications:<br />
Describes the implementation of new <strong>Domino</strong> applications or additional instances of<br />
existing applications according to predefined processes.<br />
These processes include the collection of metadata in the application repository as<br />
well as categorizing applications, quality control, and implementing them into<br />
monitoring systems and backup.<br />
Operation of applications:<br />
To operate an application, there is more than just providing CPU, memory,or disk<br />
capacity. It means operational tasks that are related to the application itself, such as<br />
full-text indexing, scheduling agents, or taking care of add-on tasks which have been<br />
installed on the server to support this application.<br />
Troubleshooting:<br />
Analyze error messages and warnings in case of outages or application errors that<br />
lead to partial or complete unavailability of the application.<br />
Periodic review:<br />
Regular (for example, every three months) verification of application parameters,<br />
data growth, number of users accessing an application and its performance impact.<br />
This includes to check if an application that originally was developed as a small-andsimple<br />
application requires to be optimized due to its growing number of users.<br />
Application change management:<br />
Implementation of changes in production applications, version updates, or functional<br />
enhancements should be performed by applying change management rules.<br />
Access management:<br />
Change access rights to an application by adding members or roles to the access<br />
control list (ACL).<br />
Note: Maintaining access rights is to be done by the owner of that application who<br />
should be allowed to modify the group members, but not be allowed to modify the<br />
ACL.<br />
Creation of usage and billing reports:<br />
Supply information about the usage of an application to the application owner on a<br />
regular basis.<br />
Rollback and archive:<br />
On request of the application owner, delete or archive applications from a system.<br />
33 of 217
Not in scope of the application services is the training of users, or the development of<br />
individual applications.<br />
Application standards<br />
Application standards in this context lay the foundation for a streamlined operation. By<br />
defining and writing down these standards, the operation team and developers will have<br />
a common understanding of what rules do apply to the <strong>Domino</strong> applications in<br />
production. Those rules can describe a variety of elements that apply to a production<br />
environment. Here are a few examples of what application standards you can define:<br />
<br />
<br />
<br />
<br />
Organizational:<br />
These type of standards define, for example, who owns an application, how to handle<br />
situations where the owner is changing, what is the procedure for creating additional<br />
replicas on other servers, and what is to be done for removing an application from the<br />
server.<br />
Do not think about the technical actions, think more about the communication and<br />
process point of view.<br />
One highly recommended organizational standard is to define that each application<br />
must have one application owner. Also describe what happens if this is not the case,<br />
for example, "if the owner is not identified, the application will be removed from the<br />
system by the end of the month."<br />
Access rights<br />
What should an ACL look like, are individual user names allowed, or do you only use<br />
groups. If so, what naming standard should be applied<br />
Is it allowed to create personal or shared views at runtime What is the maximum<br />
access right for typical users, here you do not want to have anyone with Manager or<br />
Designer rights.<br />
What is the maximum access right for developers and application owners in<br />
production Again, in a production environment, only administrators should have<br />
design authority.<br />
Properties:<br />
Take a look at the properties of a typical <strong>Domino</strong> application, and define which of<br />
those properties are the "standard" in your environment.<br />
Describe what a setting should look like and why you have decided to enable or<br />
disable it. Discuss individual settings with your peers. For example, What should a full<br />
text index look like by default Do you want to index attachments by default Want to<br />
index encrypted fields What update frequency do you want to use<br />
The developers and administrators might have a different understanding because<br />
additional functionality often goes along with an increased server impact in one or the<br />
other way.<br />
Design:<br />
Define a set of common rules that apply to the design of an application. This is not<br />
meant to be a complete coding standard definition, but should define corporate design<br />
elements, preferred user interface elements, colors, and themes. One example could<br />
be to use the <strong>IBM</strong> OneUI theme for all newly developed applications.<br />
Standards for <strong>Domino</strong> servers<br />
Similar to the standards for applications, the standards for <strong>Domino</strong> servers describe how<br />
a servers are to be configured in production. Focus is not on exceptions, its more about<br />
the settings that will be applied to new servers once they are set up. How to document<br />
standards for <strong>Domino</strong> servers is explained in Chapter 11 1.1 Documentation of the <strong>IBM</strong><br />
Redbooks wiki "Optimizing <strong>Domino</strong> Administration".<br />
34 of 217
Application classes<br />
As part of the application hosting strategy, <strong>Domino</strong> applications should be separated into<br />
classes to provide optimal resources by applying different hosting strategies.<br />
Categorizing an application into a class is an important factor for optimizing the<br />
infrastructure and reducing total cost of ownership (TCO). For that reason, the class of an<br />
application cannot be determined by looking at file size, number of documents, or number<br />
of users alone.<br />
Small applications that have a small number of documents might be small in size but<br />
have a bad application design that can lead to higher resource required than a welldesigned<br />
large scale <strong>Domino</strong> applications with thousands of users. By defining classes,<br />
application developers and infrastructure teams can work together to optimize the<br />
<strong>Domino</strong> hosting environment for best performance and user satisfaction. For example, a<br />
large number of applications that have a low infrastructure impact can be placed on the<br />
same server, while heavy applications with special needs can be given the optimal<br />
resources by placing them on the servers with just a few other applications or even<br />
hosting them on the dedicated servers.<br />
The following categories are examples that can be extended or shortened according to<br />
your needs:<br />
<br />
<br />
<br />
Standard:<br />
Are most likely based on a (corporate) template and have the following properties:<br />
o No or only small number scheduled background agents.<br />
o Number of views
Billing framework<br />
Depending on your organization type, you might not need a billing framework because all<br />
costs are just covered by your organization. However, certain, especially largeorganizations,<br />
want to recover the hosting costs from those individuals who are using it,<br />
meaning they would like to charge back the cost for each application. Because the size of<br />
a database does not indicate how much CPU power it will consume, a key problem here<br />
is to find a fair method of identifying the costs of the application. Such a billing framework<br />
should therefore, defined on corporate level with measurable criteria that allows all<br />
stakeholders to take action for reducing costs.<br />
Describe which building blocks apply to your organization, and if, where, and how you will<br />
charge for the <strong>Domino</strong> applications. This clarification should separate one time costs and<br />
recurring costs.<br />
One time costs might apply for:<br />
<br />
<br />
<br />
Rolling out a new application in a production environment<br />
Version updates<br />
Archiving or rolling back an application<br />
The recurring costs might apply for :<br />
<br />
<br />
<br />
<br />
Infrastructure cost, for example, server and network usage, backup, and<br />
monitoring<br />
High availability (clustering)<br />
Storage consumption<br />
Troubleshooting and support<br />
An approach to define a billing framework is often done by using the application file size<br />
as an indication for its real cost. Although developers and administrators know that this is<br />
not the perfect criteria, its often done this way for simplification of the billing process. By<br />
using <strong>Domino</strong> Attachment and Object Service (DAOS) in <strong>Domino</strong> 8.5, this might become<br />
an issue because the real size of the NSF file does not indicate its logical size, nor the<br />
logical size indicates how much storage is really used by this application on the servers<br />
disk.<br />
This example shows four applications, each 1000 MB in size, but each with a different<br />
number of attachments. While the first one does not contain any attachment, the second<br />
contains 600 MB attachments, the third 500 MB, and the fourth 400 MB. For each the<br />
size displayed to end users is 1 Gbyte.<br />
36 of 217
Where in reality, attachments are not stored within the NSF file in all cases. In our<br />
example, the first application is not enabled for DAOS and all other are enabled to<br />
participate in single instancing. So each of those applications is using a different share<br />
from the DAOS storage. Therefore, charging four times 1 Gbyte would not reflect the<br />
reality.<br />
The following approach can be a resolution to this problem:<br />
Lets calculate storage consumption based on the real savings from using DAOS. Savings<br />
from single instancing are calculated per server and result in a "DAOS ratio".<br />
This DAOS ratio is calculated by taking the total size of all DAOS objects dividied by<br />
(Logical size of all files – Physical size of all files).<br />
For each application, the individual storage consumption is calculated based on the<br />
following formula:<br />
physical file size + (Logical Size – Physical Size) multiplied by the DAOS ratio which was<br />
calculated above.<br />
As a result, each application will be reported with a file size that reflects the storage used<br />
on the server.<br />
37 of 217
The side effects of such a storage reporting system are:<br />
<br />
<br />
<br />
<br />
<br />
Owners are not able to verify storage consumption or applications themselves<br />
because they cant see the total amount of DAOS storage used by that server.<br />
Owners can only see the logical file size that is more than he is really using.<br />
Quota calculation (which may apply to applications) is done based on the logical size.<br />
The DAOS effect will differ from server to server. If the same application hosted on<br />
different servers, it will (most likely) not have the same DAOS savings, and therefore,<br />
showing different numbers in a report.<br />
Large servers with a lot of applications will most likely have a bigger benefit from<br />
DAOS than small servers.<br />
Conclusion<br />
When all these standards and procedures are described and are published so that<br />
everyone in the organization can access them at any time, a foundation for smooth<br />
<strong>Domino</strong> application operation is set. Describing the background and process details will<br />
help to streamline application operation.<br />
2.7.2 Application management process<br />
While the application management strategy in the previous section focuses on the<br />
infrastructure services that lay the foundation for applications, in this section, we provide<br />
the information about application specific processes in a production environment.<br />
From QA to production<br />
When an application has been fully tested and approved to be ready for production<br />
deployment, the developer or application owner will initiate the rollout process.<br />
An application is handed over from the quality assurance (QA) environment to production<br />
by using one (or more) templates and a set of instructions for the administrator to apply<br />
the template to an existing application or to create a new application based on this<br />
template. For more details, refer to: 3.1 Using development, QA, and production servers.<br />
Since this process is most likely the same every time a new application is rolled out, you<br />
can automate this process by building a custom application that helps to manage this<br />
workflow.<br />
38 of 217
Furthermore, there are application management tools for <strong>Domino</strong> available on the market<br />
that help to simplify and streamline this process.<br />
When deploying an application from QA environment to the production system, the<br />
administrators should consider the following:<br />
<br />
<br />
<br />
<br />
<br />
<br />
Register each application in an application repository, which describes the purpose,<br />
ownership, location, and interfaces of this application.<br />
Not that this is not the Database Catelog (catalog.nsf) that <strong>Domino</strong> servers maintain<br />
automatically.<br />
Stay in contact with application developers, work together to improve efficiency of the<br />
environment and resolve issues in a cooperative way.<br />
Store the templates and instructions supplied in a separate application.<br />
This could be the application repository or another different application and is useful<br />
to review code changes that have been applied over time. Such a template repository<br />
will keep track of versions and might be shared among the developers and<br />
administrators.<br />
Use unique file names for applications, this will help to avoid problem in a multiserver<br />
environment where applications replicate and look up each other, for example,<br />
by referring to the file name.<br />
Use groups for access control list (ACL) management, and allow application owners<br />
to maintain those groups.<br />
Use a special signing ID file to sign design elements of the supplied template, do not<br />
use the server ID or administrator's personal ID because this might cause problems<br />
when the application is moved to other servers or if the name of the administrator<br />
changes.<br />
Production<br />
Once the application is deployed to the production system, the regular production<br />
maintenance routine starts. Although the majority of work now is in control of a <strong>Domino</strong><br />
administrator, developers are required to manage, for example, the performance impact<br />
of the growing <strong>Domino</strong> applications once they are deployed.<br />
Access rights management<br />
In an efficient <strong>Domino</strong> environment, access rights management does not require<br />
administrators to perform any changes because application owners are able to grant and<br />
deny access to users by modifying groups in the <strong>Domino</strong> Directory. You should document<br />
the process for the users to find this information easily, for example, by establishing a<br />
wiki that explains how owners can manage access rights by themselves.<br />
Consider these good practices for access rights management:<br />
<br />
<br />
Manager and designer access are exclusive to administrators and servers.<br />
No user and no developer should have access rights higher than Editor in a<br />
production environment. Changes in existing applications should be performed by the<br />
<strong>Domino</strong> administrator by handing over design templates to the <strong>Domino</strong> administrator.<br />
This process should be agreed and documented within your organization.<br />
Run scheduled agents that require restricted or unrestricted functions using "On<br />
behalf of" with an application ID,<br />
This ID does not need to be a real Notes ID, it is just a name that you will use to grant<br />
access to resources that the agent has to access. This method allows you to grant<br />
39 of 217
and deny access in a more granular way.<br />
Availability<br />
Availability of an application includes more than the ability to open the application as<br />
such. The application must function as defined in the requirements and must work as<br />
expected by users. The term availability is often misunderstood as end-to-end availability,<br />
anywhere, anytime. This type of availability is often beyond the management ability of the<br />
administrators and developers because they only have a subset of the environment in<br />
control. For an end-to-end availability, other components such as local and wide area<br />
network, user device, and so on are of importance. Therefore, if end-to-end availability is<br />
a requirements, the application should be designed to meet this criteria by including a<br />
broader vision on infrastructure.<br />
In order to improve availability of a <strong>Domino</strong> application, the following items should be<br />
evaluated:<br />
<br />
<br />
<br />
Utilize <strong>Domino</strong> clustering to provide high availability.<br />
This requires an application to be built for clustering, which means developers have<br />
to avoid using, for example, references to individual server names or using unique<br />
numbering systems that are computed on one server only.<br />
Decentralizing <strong>Domino</strong> application servers.<br />
While consolidation and centralization is good for mail servers, <strong>Domino</strong> applications<br />
work very well in a decentralized environment. Local application servers can provide<br />
users who are in the locations with poor network connections the performance and<br />
application availability they require.<br />
Separating applications with low performance needs from those with high<br />
performance needs.<br />
This is where the classification of applications becomes important. With this<br />
classification, the administrators can host a large number of small applications on<br />
one server, while a different server is hosting a low number of applications with high<br />
performance needs.<br />
Monitoring<br />
Once an application is established in an environment, it should be monitored. You should<br />
separate the infrastructure monitoring from the application monitoring. For infrastructure<br />
monitoring, refer to the <strong>IBM</strong> Redbooks publication Optimizing <strong>Domino</strong> Administration,<br />
Chapter 3.1:<br />
40 of 217
http://www-<br />
10.lotus.com/ldd/dominowiki.nsf/dx/Table_of_Contents_Optimizing_<strong>Lotus</strong>_<strong>Domino</strong>_Admi<br />
nistration<br />
While in some environments, it is acceptable to monitor the infrastructure and <strong>Domino</strong><br />
server layer only, the complex environments with business critical applications might<br />
have certain applications that require more attention. However, due to the large variety of<br />
<strong>Domino</strong> applications and its functionality, it is not possible to predefine what should be<br />
monitored within an application. This list will give a short overview if what can be<br />
monitored:<br />
<br />
<br />
<br />
Usage tendency: For example, number of read and write activities, FTIndex usage,<br />
Growth statistics: For example, number of documents in the database, number of<br />
custom views and folders, size of documents and the attachments within<br />
Efficiency: For example, Agent runtime, time to render a specific page number.<br />
You can monitor these triggers from within the application itself by custom developed<br />
monitoring agents that alert the application operators in case of any abnormal or can be<br />
part of an existing application monitoring system for example, <strong>Domino</strong> Domain Monitoring<br />
(DDM) or Tivoli ITCAM for applications.<br />
Virus scanning<br />
Virus scanning is important in every environment regardless of its size, however,<br />
individual settings and practices might cause drawbacks on system health or<br />
performance.<br />
A common approach is to enable virus scanning on both the server and the workstation,<br />
while each of them focus on different items. Serious performance issues can occur if<br />
virus scanners on operating system level are configured wrong. Since Notes and <strong>Domino</strong><br />
are accessing and modifying a large number of files on the disks at the same time, local<br />
virus scanners will interrupt read and write access at every time. Therefore, the disk I/O<br />
throughput for the server and the client will reduce dramatically resulting in a<br />
performance issue.<br />
Here are a few examples to outline which anti virus settings should be used:<br />
<br />
<br />
<br />
<br />
Operating system virus scanner shall be configured to skip any Notes or <strong>Domino</strong><br />
data.<br />
Application specific virus scanners shall be used to scan <strong>Domino</strong> data,<br />
Scanning applications on access will ensure that a document or attachment that is<br />
being opened by a user does not contain any virus.<br />
Virus scanners shall not modify documents stored in applications, although it might<br />
sound like reasonable for cleaning a virus. This will cause replication conflict<br />
problems when an application is distributed to multiple servers.<br />
Backup and recovery<br />
A <strong>Lotus</strong> <strong>Domino</strong> server backup can not be handled like a file server because <strong>Domino</strong> is<br />
keeping a large number of files opened and is performing background actions against<br />
those open files even if there is no user accessing them. Relying on normal backup<br />
software that is not aware of how to handle open files can be dangerous, as this software<br />
might claim a file as locked when <strong>Domino</strong> is trying to access. This will cause the “This<br />
database is currently being used by someone else...” error in <strong>Domino</strong>.<br />
41 of 217
For more information about <strong>Domino</strong> server backup and recovery, refer to http://www-<br />
10.lotus.com/ldd/dominowiki.nsf/dx/3.9_Backup_a_<strong>Domino</strong>_Environment.<br />
Remember the following<br />
<br />
<br />
<br />
<br />
Define and understand the backup policy of your corporation. Certain data might be<br />
required legally to be kept for longer than other data, so an individual backup plan for<br />
an application might be required while other applications can use the default server<br />
backup routine.<br />
Include the <strong>Domino</strong> Attachment and Object Services (DAOS) repository in your<br />
backup and recovery plan.<br />
Perform regular tests against the backup infrastructure to make sure you can restore<br />
the data that was backed up.<br />
For example, perform a full restore to an empty server once per year.<br />
Define your application restore scenario in written form, and make sure the<br />
administrators have an appropriate understanding of specific actions that must or<br />
must not be performed. for example, some applications contain scheduled agents<br />
that run by schedule to send mails. When restoring an application to a different<br />
server, you might not want those mails to be sent. Therefore, define what needs to be<br />
done to avoid this.<br />
For additional information on how to efficiently restore an application, refer to http://www-<br />
10.lotus.com/ldd/dominowiki.nsf/dx/3.10_Restore<br />
2.8. Upgrade<br />
2.8.1 Upgrading applications<br />
When it comes time to upgrade your application, there are things you, as a developer,<br />
can do to make the upgrade process easier. Here are some best practices for upgrading<br />
your <strong>Domino</strong> applications.<br />
Using templates<br />
An NSF file generally contains both the data of the application and the design used to<br />
manage that data. However, to avoid problems in managing the maintenance of your<br />
application, it's better if you manage the data and the design in separate files, so that you<br />
can edit the design, and fully test the changes, without affecting the application that's in<br />
actual use. In addition, it is often the case that a design may be duplicated into multiple<br />
NSF files which contain different data. One obvious example is the user mail file, where<br />
each user has a copy of the mail file design, but it has their own data in it.<br />
Templates provide a way to edit the design centrally and away from the application data.<br />
Once you are satisfied your changes are correct, you can apply the updated design to<br />
application databases, either directly or by placing an updated copy of the template on<br />
your servers, where the nightly DESIGN task will update applications.<br />
<strong>Domino</strong> templates generally have a NTF file extension, but the true thing that makes a<br />
<strong>Domino</strong> application a template is the “Is A Template” setting found on the design tab of<br />
42 of 217
the application properties:<br />
43 of 217
Any application that has the same value in the “Inherit from Template” setting in<br />
application properties inherits design elements from this template whenever the server's<br />
Design task runs. By default, the Design task runs at 1:00 AM daily, however, this can be<br />
changed (or even disabled) by a <strong>Domino</strong> Administrator.<br />
Individual design element inheritance<br />
Individual design elements can be marked to inherit their design from a specific template,<br />
or be set to not inherit from any template. These are done on the properties of the<br />
individual design element.<br />
You can set this option on design elements an an application. As a general rule, this is<br />
only a good idea when the design contains elements that are supposed to be customized<br />
to the occurrence of the application -- they're supposed to be different from the template.<br />
With the exception of personal views and folders (such as in mail files), or customized<br />
44 of 217
graphics or stylesheets that are different in each instantiation of the design, this is rare. In<br />
nearly all cases, it's best to manage the design of the application by editing the template,<br />
and making the application design identical to the template design. In cases where you<br />
have two designs that share some design elements, the template for one application can<br />
inherit its design from another template, with certain design elements exempted by<br />
checking their "Prohibit design refresh..." checkbox. Or if two templates have just a few<br />
elements in common, one can inherit only specific elements by adding the source<br />
template name in the "Inherit from..." field.<br />
The danger of working in this way is that if part of your design changes without your<br />
awareness, because someone edited the template from which you inherit, it can break<br />
your application. Design elements are often interrelated; for instance, a form might<br />
contain a field formula that uses @DbLookup to find a key in a view, and read a value<br />
from a certain column. If someone changes the view, you may now be reading from the<br />
wrong column. You would definitely, at least, want to not accept updates automatically,<br />
but first test the changes to make sure there's no problem introduced. You may find it<br />
better to simply copy the design you want to customize to a new template with a different<br />
name, with no inheritance, and use other means to track reusable design elements.<br />
Use special caution in allowing automatic inheritance of code-based design elements.<br />
For any code, there's a danger that someone will change the design in a way that will<br />
make it fail when called by existing code -- for instance, by inserting an argument in the<br />
middle of a function list, so that existing calls to that function are no longer correct.<br />
<strong>Lotus</strong>Script code has the additional limitation that it is compiled in the context of existing<br />
code that it calls in the same application. If a script library is modified without recompiling<br />
the other <strong>Lotus</strong>Script code that calls the library, the library can fail to load even if the<br />
profiles of the functions it makes calls to have not changed. There's no search that will<br />
identify all the places where a particular library is used across all applications. Therefore,<br />
it's generally better to allow the maintainers of different applications to determine when<br />
and if they will incorporate a new version of a common library into their designs. Allowing<br />
these to inherit automatically across the organization will almost certainly cause<br />
applications to fail in the field.<br />
Generally speaking, it's a bad idea to control inheritance of individual design elements in<br />
an NSF file, since that's means you're assembling the final design for the first time in your<br />
production environment, without ever having tested it. If anything is to inherit individual<br />
design elements, it should be a template. Use the template to create test NSFs to try out<br />
upcoming changes before you release them to users.<br />
2.8.2 Putting changes into production<br />
When you are changing the production design of your application, there are general rules<br />
to follow to make sure the deployment works smoothly.<br />
Back up existing design<br />
First, you should make a back up copy of the current production template. You can revert<br />
back to that design in the case of a failure or unforeseen issue.<br />
Document data migration procedures<br />
If data needs to be migrated because of the new design (adding a new field that your new<br />
design requires, for example), then you should include data migration agents to update<br />
45 of 217
the data, and document the steps required to run the agents. You should also work with<br />
your <strong>Domino</strong> Administrator to make sure that the data migration happens soon after the<br />
design is upgraded in order to decrease the potential for end user errors from using the<br />
new design with the old data.<br />
If possible, design your new version to work acceptably with the old style data as well as<br />
the new, so that no migration process is needed. If you cannot find a way to do this, you<br />
definitely don't want to allow the Design task to update that design automatically.<br />
Document data reversion procedures<br />
For every data migration agent you have, you should also have a data reversion agent<br />
that will “undo” the migration in the case of a failure. If you have to revert back to the<br />
original design, you need a way to revert back to the original data. The agents that need<br />
to be run in the case of a reversion have to be documented.<br />
Verification of success<br />
After upgrading the application and migrating the data, you should have one or more<br />
users verify the new functionality of the application in production. Users should have<br />
already validated that the functionality does what they asked in a development<br />
environment, however, this is making sure the design elements were properly refreshed<br />
and the data properly migrated in production.<br />
2.8.3 Deployment steps<br />
You should check with your <strong>Domino</strong> Administrator for the exact steps your company uses<br />
to deploy changes to <strong>Domino</strong> applications. If the Design task has been disabled on the<br />
server, the design of the production application must be manually refreshed after<br />
deploying an updated template. If templates are not allowed to be stored on the<br />
production servers, someone with the proper authority and access have to manually<br />
refresh the design of the production application from a local template. Every company<br />
may have slightly different procedures for upgrading applications, but those procedures<br />
should be documented by the <strong>Domino</strong> Administration team.<br />
2.9. Retirement<br />
The <strong>Domino</strong> application portfolio of an enterprise can grow into a huge number of<br />
applications over time, deployed to leverage the existing <strong>Domino</strong> infrastructure or use of<br />
rapid application development (RAD) environment to build new capabilities to support the<br />
growing business. The document repositories and discussion databases can increase<br />
rapidly if applications are created across regions without proper planning and<br />
governance. Applications added to the <strong>Domino</strong> application portfolio without central<br />
monitoring can possibly lead to inefficiency in managing the <strong>Domino</strong> infrastructure due to<br />
redundancy, dormancy, under-utilization, and expiration. The process of application<br />
retirement or application sunset is a good practice to keep <strong>Domino</strong> infrastructure lean and<br />
efficient. The additional benefit is the recovery of disk space and extra processing power<br />
for <strong>Domino</strong> server to cater the reduced number of application databases.<br />
The application retirement is an essential step in the <strong>Domino</strong> Application lifecycle. The<br />
application retirement process helps identify the applications that are under-utilized or<br />
dormant. The unused applications then can be deleted or archived. The application<br />
46 of 217
etirement process can also result in an adaption of new review practices as well as help<br />
achieve modernizing the existing under-utilized applications. The usage of legacy<br />
applications drops over the period of time because of their out-of-date technologies and<br />
not very intuitive features. Replacing these old-approach applications with the new<br />
XPages enabled Web2.0 capabilities and rich features that are much faster to build and<br />
use helps in reviving the application usage. The application retirement helps organization<br />
maintain a healthy, lean, and efficient application portfolio.<br />
For the application retirement process, have a central application repository that<br />
maintains the records of existing applications, categorized under respective portfolio, for<br />
example Quality, Sales, Marketing, Innovation, Business Intelligence, Customer Relation<br />
Management, Business Support Services, Document Management, Legal, and<br />
Discussion database. Consider forming a <strong>Domino</strong> application portfolio management<br />
committee or team to ally processes and manage central application portfolio repository.<br />
Any request for new database should go through the <strong>Domino</strong> application portfolio<br />
management process. Implement an application portfolio intelligence process built with<br />
capabilities of automated report, agents, or robots. The application portfolio management<br />
process does the following:<br />
Prepares inventory of all applications hosted on all servers across various locations.<br />
Track user activities or traffic for each application in the inventory. you could re-use the<br />
information in database catalog on each server and database usage statistics.<br />
Generate reports about dormant, under-utilized, expired, ready for renewal, retired<br />
application and decommissioned databases.<br />
47 of 217
This process helps your team to rationalize applications, their retirement, decommission,<br />
and archive to avoid redundancy and increase common share (that is to reuse existing<br />
database for similar purpose, generally the document repositories and team discussion<br />
databases). This process also helps to bring better governance, visibility, and control on<br />
the databases across <strong>Domino</strong> application portfolios at different locations. The following<br />
figure shows the state of ungoverned, governed, and retired applications, resulting from a<br />
rationalization process.<br />
48 of 217
Chapter 3. Infrastructure impact for application<br />
development<br />
This chapter discuss how the infrastructure such as severs, operating systems, <strong>Domino</strong><br />
versions can impact the <strong>Domino</strong> application development.<br />
3.1. Using development, QA, and production servers<br />
3.1.1 <strong>Domino</strong> environment<br />
<strong>Domino</strong> provides a rapid application development environment, this does not mean that<br />
one should ignore standard development practices. There should be at least a separate<br />
production environment and development server, even if there is only one developer.<br />
The normal <strong>Domino</strong> environment consists of a development domain, user testing or<br />
quality assurance (QA) domain, and the production domain . The access rights a<br />
developer has changes with each domain.<br />
The ultimate environment has the development domain and the QA domain be an<br />
identical configuration as the production domain. This in reality is cost prohibitive, so the<br />
next best setup is to have the QA domain match the configurations in production that<br />
would likely cause issues. If in production you have internal application server and<br />
servers with web access that are available to third party over the internet hosted on a<br />
secured access zone or a demilitarized zone (DMZ), then the QA domain should model<br />
that structure. The idea is to be able to test the application fully so it will not have issues<br />
when moved to production. At this point you are trying to match the overall configuration<br />
of production, not that actual setup. If you access a relational database management<br />
system (RDBMS) in production, then you must have the same access in QA. If you have<br />
five application servers in production, it does not mean that you need five for QA.<br />
Because you do not hard code server names into the application, as that would be a<br />
really bad practice, developing your application on a different server is not an issue. If<br />
you have code that accesses another database on a different server, then the target<br />
server's name should be on a profile or configuration document that can be easily<br />
changed. There is an application on OpenNTF.org that can help you maintain these<br />
configuration documents if you have a large number of applications that interact. The<br />
application even supports failover when a server is down.<br />
This figure shows what the <strong>Domino</strong> environment looks like from the server prospective.<br />
49 of 217
The management of the flow of the code between the areas can range from a<br />
simple Notes database to utilizing a third party tool to control the templates. What is the<br />
most important rule is that you have a procedure and follow it.<br />
50 of 217
3.1.2 <strong>Development</strong> environment<br />
The development server can be anything from a single virtual machine (VM) running on<br />
the developers workstation up to multiple servers. This is the area for developers to build<br />
and test the applications. If you are doing team development then the <strong>Domino</strong><br />
development server has to be on hardware that can be accessed by all developers. We<br />
discuss virtual machines and how they can be used to help with development and testing<br />
in 3.2 Multiple version support with virtual machine.<br />
For the development environment, it should be set up to allow the developers to easily<br />
change the configuration to assist with developing the applications:<br />
<br />
<br />
<br />
<br />
<br />
One or more developers should have the basic <strong>Domino</strong> Administration skills.<br />
Developers have manager access to server and applications.<br />
Developers use the <strong>Lotus</strong> Notes Administration Client to:<br />
o See view information.<br />
o Use server console to check for errors.<br />
Developer must be able to create databases and replicas on the server.<br />
Developers can change <strong>Domino</strong> Directory documents such as the Internet Site<br />
documents.<br />
The server configuration should have:<br />
<br />
<br />
<br />
<br />
No connection docs unless there are multiple development servers.<br />
Mail routing turned off, you can access the mail.box to see what messages look like.<br />
User can get confused by notifications from the development server.<br />
Developers have full access to the server's mail.box.<br />
If the production servers use SSL, then development should have at the minimum a<br />
<strong>Domino</strong> self-certificate. With the cost of SSL certificate running under $100, it is<br />
cheaper to purchase one then have to deal with the administration of the selfcertificate.<br />
The server can be in the same <strong>Domino</strong> domain as production or in its own domain:<br />
<br />
<br />
If in the same domain:<br />
o The <strong>Domino</strong> Directory is a copy of the main production domain so no chance<br />
of replication or It has its own copy and the production <strong>Domino</strong> Directory is<br />
set as a secondary address book using Directory Assistance.<br />
o Give the development server a different Notes Named Network, so users do<br />
not see it.<br />
If in a different domain:<br />
o The main production <strong>Domino</strong> Directory is set as a secondary address book<br />
using Directory Assistance.<br />
o Cross certify the development domain to the production domain to make it<br />
easier for everyone.<br />
3.1.3 QA and user testing environment<br />
Developers should have, at the most, the designer access if they are allowed to make<br />
minor code changes to QA, otherwise, they have the same access as they do to<br />
production.<br />
51 of 217
The <strong>Domino</strong> QA server configuration should match as closely to production as possible. If<br />
you have an internal <strong>Domino</strong> application server and a separate <strong>Domino</strong> server for web<br />
access in production, then you should have the same in QA.<br />
The server can be in the same <strong>Domino</strong> domain as production or in its own domain:<br />
<br />
<br />
If in the same domain:<br />
o The <strong>Domino</strong> Directory is a copy of main production domain so there is no<br />
chance of replication; or It has its own copy and the production <strong>Domino</strong><br />
Directory is set as a secondary address book using Directory Assistance.<br />
o Give the development server a different Notes Named Network, so users do<br />
not see it.<br />
If in a different domain:<br />
o The main production <strong>Domino</strong> Directory is set as a secondary address book<br />
using Directory Assistance.<br />
o Cross certify the development domain to the production domain to make it<br />
easier for everyone.<br />
3.1.4 The build process<br />
Use templates to move the design between environments.<br />
<strong>Development</strong> to QA<br />
The steps a developer takes to promote an database from development to QA are as<br />
follows:<br />
1. Create a template from the development database.<br />
2. On the template database properties, Select Database file is a master<br />
template and enter the template name.<br />
There's no fixed rule as to whether the template name should include a version number<br />
(e.g. TPL Quality Info v1.2). Usually, applications undergo continuing maintenance. If<br />
your intention for the application is that every instance of the application will have the<br />
same design, receiving updates from a single common template, it's better to not put a<br />
version number in the template name. That would just make it harder to maintain the<br />
design of the application across all instances.<br />
However, if you intend that there might be different versions of the same application on<br />
the same server, it may make sense to include the version number in the template name.<br />
This might be the case if you're developing your template as a product to sell, for<br />
instance. Different customers might deploy different versions within the same company,<br />
and you wouldn't want to have older versions automatically upgraded by the DESIGN<br />
task because someone installed a newer version of the template on the server --<br />
especially if there are data updates that should happen at the same time as the upgrade,<br />
or if the users of the application might have older clients that don't support some features<br />
used by your new version.<br />
If you do put version numbers in your template names, make sure the different versions<br />
of your template are not replicas of each other. This can lead to older version templates<br />
being overwritten by the newer version through replication, and occasionally can result in<br />
duplicated design elements in both replicas (if the design elements with the same name<br />
52 of 217
didn't have the same universal ID). This causes a huge mess.<br />
If you don't want to put the version number in the template name, but you still want to<br />
have the information stored somewhere so that you can easily tell whether a particular<br />
NSF has an up to date design, you can add the template version as non-editable<br />
information in the database property dialog, as shown below.<br />
This works in Notes/<strong>Domino</strong> 6.0.1 and later, and is done by creating an editable shared<br />
field named “$TemplateBuild”. This is a special field name recognized by the database<br />
properties code; the shared field design element contains three extra items not in a<br />
normal shared field; the items are named $TemplateBuild, $TemplateBuildName and<br />
$TemplateBuildDate. You can assign values to these extra items by a <strong>Lotus</strong>Script or<br />
Java agent.<br />
The Notes/<strong>Domino</strong> 6 discussion forum contains sample <strong>Lotus</strong>Script code, written by<br />
Thomas Gumz, for retrieving the version information in the $TemplateBuild element. The<br />
following code snippet is a modification to assign the values of these parameters in the<br />
template. It assumes that it is running in the same template that is to be modified; of<br />
53 of 217
course, you can also modify this code to operate on another database whose path is<br />
supplied as an argument the the constructor of NotesDatabase.<br />
'....Author: Thomas Gumz<br />
Dim session As NotesSession<br />
Dim db As NotesDatabase<br />
Dim nc As NotesNoteCollection<br />
Dim doc As NotesDocument<br />
Dim iCount As Integer<br />
Dim sNoteID As String<br />
Const ITEM_BUILD = "$TemplateBuild" '.....Modified<br />
Const ITEM_BUILD_NAME = "$TemplateBuildName" '.....Modified<br />
Const ITEM_BUILD_DATE = "$TemplateBuildDate"<br />
Set session = New NotesSession<br />
Set db = session.CurrentDatabase<br />
Set nc = db.CreateNoteCollection(False)<br />
If Not nc Is Nothing Then<br />
nc.SelectSharedFields = True<br />
Call nc.BuildCollection<br />
sNoteID = nc.GetFirstNoteId<br />
For iCount = 1 To nc.Count<br />
Set doc = db.GetDocumentByID(sNoteID)<br />
If Not doc Is Nothing Then<br />
If doc.HasItem(ITEM_BUILD) Then<br />
'.... Msgbox "Version: " & doc.GetItemValue(ITEM_BUILD_NAME)(0)<br />
Call doc.ReplaceItemValue( ITEM_BUILD, "v1.2" ) '.....Modified<br />
Call doc.ReplaceItemValue( ITEM_BUILD_NAME, "TPL Quality Info" )<br />
'.....Modified<br />
Call doc.ReplaceItemValue( ITEM_BUILD_DATE, Now() ) '.....Modified<br />
'.... Msgbox "Date: " & doc.GetItemValue(ITEM_BUILD_DATE)(0)<br />
Call doc.Save(True, False)<br />
Exit For<br />
End If<br />
End If<br />
sNoteID = nc.GetNextNoteID(sNoteID)<br />
Next iCount<br />
The following figure shows a sample output after running the above code:<br />
1. Provide the template and the related information such as the agents that have to<br />
clean up the data, fixes, and so on to the QA Administrator.<br />
54 of 217
2. The QA administrator then perform the following:<br />
a. Copy the template on the QA server.<br />
b. Sign the template using the server ID, their ID, or a test ID.<br />
c. In the QA environment, enable the target database property of inheritance to<br />
inherit from the master template. Then refresh the design of this target<br />
database in the QA environment. On successful refreshing the template, the<br />
version details will appear as additional information (See the figure below).<br />
d. Notify the QA team that the application is ready for testing.<br />
Let us review how <strong>Domino</strong> design refresh works: When you select a <strong>Domino</strong> application<br />
and select File -> Database -> Refresh Design, <strong>Domino</strong> retrieves the database's<br />
template name found on the design tab of the database properties box and then locates<br />
the template with that master template name. <strong>Domino</strong> matches up design elements<br />
between the application and the template, deciding which are to be updated, added or<br />
deleted. This matching algorithm is fairly complicated, using the universal ID of the<br />
design notes, the value in the $TITLE item (particularly the last value, the alias), the<br />
language setting if this is a multilingual application, and the Notes/web/modile setting.<br />
These last two are used in case there are design elements with the same name but<br />
different languages, or designed for different clients. Generally speaking, the details of<br />
55 of 217
how the match is done aren't important, but if it seems like design replace/refresh isn't<br />
working as you expected, consider the possibility that by renaming a design element, you<br />
have made the design replace process not realize that it's "the same" design element as<br />
before.<br />
Testing the application<br />
For testing, you must have test IDs that represent the different levels of access that user<br />
can have with the application. If you have users the are reader and others can edit, then<br />
you need test IDs with the same access level. <strong>Domino</strong> has the ability to hide and control<br />
access to everything from the application down to the individual design elements.<br />
The application has to be tested not only for correct functionality but also using the client<br />
application that the end user will be utilizing. Different version of the Notes clients do not<br />
have as much issues as different version of browsers have. Unless this is for internal use<br />
and everyone has the same browser, you have to be able to test the application with a<br />
variety of browsers and versions. There is a few open source tools that can be used for<br />
testing web based applications. The benefit of using these are that you can test overall<br />
functionality very easily and be sure there are no regression issues. Your changes to one<br />
form may cause another form or code to now malfunction.<br />
Testing the entire application for each release can be very time consuming. That is why it<br />
is important to document the changes made in development and build a test case for<br />
those changes. The test case will indicate what functionality the users should see. It<br />
should correspond to the original change or design request. An example is adding a new<br />
form for the user, the design requirements will list the fields and the expected workflow.<br />
The test case would be the steps the user will take to utilize the form and the expected<br />
out come.<br />
Especially for new applications, performance testing under realistic conditions of server<br />
load and number of documents is very important. We very commonly see applications<br />
that worked fine with a few dozen test documents and one user, but once they get tens of<br />
thousands of documents, their performance suffers badly. These problems can be<br />
addressed by following the design principles in the whitepaper "Performance basics for<br />
<strong>IBM</strong> <strong>Lotus</strong> Notes developers."<br />
QA to production<br />
When the application has been fully tested, there should have an approval process to<br />
indicate it is ready for production deployment. Provide the template and related<br />
information such as the agents that have to clean up the data, fixes, and so on, to the<br />
production administrator. The Production administrator then do the following:<br />
1. Sign the template using the server's ID or the administrator ID used for signing.<br />
2. Apply the QA template to the appropriate <strong>Domino</strong> database.<br />
3. Run any update agents that are needed.<br />
4. Enable all scheduled agents.<br />
5. Notify users of updates<br />
56 of 217
3.2. Multiple version support with virtual machine<br />
3.2.1 What is a virtual machine<br />
A virtual machine (VM) is a software application that allows you to have a simulated<br />
computer that executes programs like a physical machine. This lets you test applications<br />
in an controlled environment. You can configure the hardware that the virtual image<br />
thinks it has access to. The benefit is that you have a large file instead of having an<br />
actual computer. This allows you to easily back it up or to copy it to different physical<br />
computers. Some of the versions of virtual machine provide for versioning, cloning, and<br />
linking of virtual machine images, to make it easier to create and use. With a virtual<br />
machine, the computer the virtual machine application is running on is considered the<br />
host and the virtual machines are the guests. One of the criteria in selecting a virtual<br />
machine application for development is which Operating Systems are needed for testing<br />
and which Operating Systems are you running on the host system. The selection of the<br />
guest's Operating System is sometimes restricted, also some are restricted to run on<br />
certain host Operating System.<br />
Some of the virtual machine applications available allow the user of multiple virtual<br />
machines running on the same computer. This allows you to have multiple virtual<br />
machines running at the same time on your computer.<br />
There are versions of virtual machine application that include their own Operating<br />
System, so they do not run on a host Operating System. This provides for less overhead<br />
which results in better performance. These are used in server consolidation since they<br />
are best for performance.<br />
The main advantages of virtual machines are:<br />
Multiple Operating System environments can coexist on the same computer, in<br />
complete isolation from each other.<br />
You can test applications, maintenance, high availability, and disaster recovery.<br />
The main disadvantages of virtual machines are:<br />
The virtual machine is less efficient than a real computer as it accesses the hardware<br />
indirectly.<br />
When multiple virtual machines are concurrently running on the same physical host,<br />
each virtual machine may exhibit varying performance, which highly depends on the<br />
workload imposed on the system by other virtual machines.<br />
They share the memory and storage of the host and are therefore limited to how<br />
much they can utilize.<br />
The reasons for using a virtual machine include:<br />
Develop and test multiple <strong>Domino</strong> and Notes versions on a single personal computer.<br />
Connect virtual machines to simulate and test multi-server configurations.<br />
Use multiple snapshots to facilitate testing.<br />
Archive test environments on file servers where they can be easily restored and<br />
shared.<br />
Less need to keep buying hardware or to clean machines.<br />
The virtual machine can be configure to "roll-back" all changes when shutdown.<br />
Test older <strong>Domino</strong> Server versions within virtual machines.<br />
Crash a server and not impact other developers or your personal computer.<br />
Test how applications perform with poor network connectivity.<br />
Testing <strong>Domino</strong> applications running on different Operating Systems.<br />
57 of 217
Testing a cluster's failover impact to your application.<br />
Test applications using different browser versions.<br />
The following are some of the currently available virtual machine applications:<br />
VirtualBox is an open source virtual machine developed by Sun Microsystems (now<br />
owned by Oracle Corporation). Works extremely nice on Ubuntu workstations.<br />
VMware provides virtual machines for x86.<br />
Xen virtualization system is intended to run a moderate number of full-featured<br />
operating systems, Linux, Solaris, as well as Windows XP and 2003 Server (requires<br />
Version. 3.0 and an Intel VT-x(Vanderpool) or AMD-V (Pacifica)-capable CPU).<br />
KVM is a Linux kernel module maintained by Red Hat, that enables a modified<br />
QEMU program to use hardware virtualization.<br />
Virtual PC from Microsoft allows Windows 7 to run virtual Windows XP, Windows<br />
Vista, and Windows 7 as guests.<br />
Hyper-V from Microsoft runs on Server 2008 R2.<br />
Parallels Workstation supported host Operating System are Mac, Windows, and<br />
Linux.<br />
3.2.2 Virtualization best practices<br />
When use virtual machine for <strong>Domino</strong> application, consider the following. Note that some<br />
of the recommendations might not be valid for every virtual machine application.<br />
Allocate fixed memory size and fixed disk size.<br />
If possible, run all the virtual machines RAM in real RAM, avoid swapping.<br />
Do not limit the RAM the virtual machine can effectively use .<br />
<strong>Lotus</strong> <strong>Domino</strong> calculates its cache size based on Operating System available<br />
memory. It is not aware of artificial limitations imposed by virtual machines.<br />
In Memory -> Resources, the “Unlimited” really means “up to the amount allocated to<br />
the virtual machine”, therefore, is the correct setting.<br />
Do not share volumes.<br />
Pre-allocate disk space and install on a recently defragmented drive.<br />
Use virtual machine file store volumes instead of directly allocated physical volumes.<br />
Defragment drives - Defragment drives on both virtual machine and the host system<br />
of the virtual machine.<br />
Create virtual machines on a different partition to the host operating system or swap<br />
file. It makes sense to store virtual machine images on fast external USB, Firewire, or<br />
eSata drives.<br />
Turn off hardware devices that are not required in the virtual machine such as USB<br />
ports, Sound Devices, Floppy Disks, and CDs.<br />
Configure the virtual machine to start with the CD and DVD optical drive<br />
disconnected.<br />
Either set fixed one CPU or two to n CPUs.<br />
With low CPU demand configuring one fixed CPU should give best performance.<br />
Never allocate more CPUs then the host system has.<br />
The guest operating systems have different kernels for single or multiple and 32-bit or<br />
64-bit CPUs.<br />
Use a host with a 64-bit CPU to test guest that will run on 64-bit operating systems.<br />
Enable hyper-threading on the host machine.<br />
If using VMware then install virtual machine Tools.<br />
58 of 217
Small machine example for <strong>Domino</strong> application server might have the following<br />
configuration:<br />
32 bit<br />
1 CPU<br />
Max 3 GB RAM (more is not effective on a 32 bit machine)<br />
3.2.3 Snapshots<br />
A disk snapshot is a copy of the virtual machine disk file recorded at a specific time. The<br />
snapshot preserves the original VM disk file by disabling writes to the original disk file. All<br />
the new writes are made to the snapshot version of the VM.Snapshots. Because the<br />
snapshot file is only a change log of the original virtual disk, it is not a backup and you<br />
should not rely upon it as a direct backup process. The virtual machine is running on<br />
the most current snapshot, not the original vmdk disk files.<br />
Every VMware snapshot creates a new delta file, while the older one becomes readonly<br />
file. Since changes to the VM are made directly to the delta file, the file size<br />
keeps increasing. Multiple snapshots of a VM should be taken only if the VM has<br />
frequent changes or in case of system level changes such as patches or driver<br />
updates.<br />
Allocate 30% more storage to each VMware snapshot.<br />
<br />
<br />
Use snapshots as a versioning tool rather than as the data backup.<br />
Set the snapshots retention period according to your organization's requirements and<br />
delete the out-of- date copies. A delete operation with the VMware snapshot tool<br />
commits all the changes stored in the delta file to the original VM. Therefore, plan the<br />
snapshot deletion time. Avoid bulk deletion unless the snapshots are creating storage<br />
overhead. Delete the delta files one at a time, with the oldest copy being deleted first.<br />
Bulk delete operations should be performed when I/O activity on the original VMs is<br />
at its lowest.<br />
3.2.4 Clones<br />
Clone a virtual machine to easily deploy identical copies of a fully configured virtual<br />
machine. You can do anything with a clone that you could with the original virtual<br />
machine. The clone may be linked or full:<br />
Full clone: This is an independent copy. A full clone shares nothing with the parent<br />
after the cloning operation.<br />
Linked clone: This is a copy of a virtual machine that shares virtual disks with the<br />
parent virtual machine in an ongoing manner. Conserves disk space.<br />
3.2.5 Templates<br />
The first and simplest reason for using virtual machine templates is efficiency. With<br />
templates, many repetitive installation and configuration tasks can be avoided. The result<br />
is a fully installed, ready to operate (virtual) server in less time than manual installation.<br />
Templates are also used to help enforcing consistency and standards. Deploying from<br />
templates helps to enforce corporate standards such as including anti-virus and<br />
management software in any machine connected to the network.<br />
The use of templates is a best approach to set up a virtual machines because templates<br />
can help protecting a virtual machine image from any changes by the users. When the<br />
59 of 217
virtual machine is in template mode, it cannot be deleted or added to a team, and the<br />
virtual machine's snapshots cannot be deleted.<br />
Note: To protect the template, set the file to read only or remove write permission for the<br />
virtual machine’s files. This precaution prevents inadvertently deleting a virtual machine<br />
through the file system, or from disabling template mode for a virtual machine.<br />
3.2.6 Windows guest performance tuning<br />
Microsoft Windows offers certain simple yet highly productive tweaks that can be<br />
universally applied to any Windows virtual machine guest operating system installation.<br />
This section describes modification of certain registry entries. The Microsoft Windows<br />
registry editor is an advanced tool and should be used by advance user. Take<br />
appropriate backup of registry before you start making changes.<br />
Kernel paging<br />
Disable the kernel paging of code to give a performance boost. It improves performance<br />
on machines with a lot of memory, because it prevents disk reads to get code or data,<br />
below are the registry entries to be edited:<br />
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session<br />
Manager\Memory Management<br />
Value name: DisablePagingExecutive<br />
Data Type : REG_DWORD<br />
Data : 0 or 1 (Default is 0)<br />
Set to 1 to stop paging for “pagable” parts of kernel drivers. This can use more<br />
system memory but run faster.<br />
I/O Tuning<br />
This entry controls the maximum amount of RAM that can be locked for I/O operations.<br />
The default minimizes RAM usage. An I/O intensive system could benefit from larger<br />
buffer sizes.<br />
Caution: Setting this parameter too high can result in slower performance. Set it in<br />
increments and see how it affects your system. A rule of thumb is to set to a value<br />
calculated by using the formula "Total RAM size in KBs divided by 8". Edit these registry<br />
entries to improve I/O performance:<br />
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session<br />
Manager\Memory Management<br />
Value name: IOPageLockLimit,<br />
Data: Set to a calculated decimal value of the total RAM size in kBytes divided by 8<br />
Increase performance by disabling the last access update file's date.<br />
The following changes are to set the operating system to disable last access update for<br />
directories and files on the Windows server, which translates into a radical reduction in<br />
the total I/O. Because the <strong>Domino</strong> processes access the data files frequently and have<br />
their own headers with time stamps within them, this saves I/O resources in updating<br />
time attributes for files or directories.<br />
<br />
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\<br />
60 of 217
Value name: NtfsDisableLastAccessUpdate.<br />
Data: Set it to 1 to stop updating the last access value.<br />
3.3. Browser considerations<br />
<strong>Lotus</strong> <strong>Domino</strong> is supported on multiple browsers. It is important that you are aware of the<br />
environment your application is supposed to work in.<br />
Modern browsers support most of the features that you can use in an XPage application ,<br />
however, you have to make sure that you cover all the pitfalls by properly testing your<br />
application in all the concerned browsers. You can also take advantage of the multiple<br />
browser support feature by asking your application to change behavior on the fly. For<br />
example, you can switch themes based on the browser user is using.<br />
List of browsers supported by <strong>Lotus</strong> <strong>Domino</strong> 8.5.3 can be found here: https://www-<br />
304.ibm.com/support/docview.wssuid=swg27022468<br />
3.4. Operating system considerations<br />
<strong>Lotus</strong> Notes and <strong>Domino</strong> are supported on multiple operating systems. It is very<br />
important that you are aware of the environment that your application is supposed to<br />
work in.<br />
Platforms supported by <strong>Lotus</strong> <strong>Domino</strong> server are: AIX, iSeries, Linux, Solaris, and<br />
Windows.<br />
Platforms supported by <strong>Lotus</strong> Notes are: Linux, Mac OS, and Windows.<br />
Platform supported by <strong>Lotus</strong> <strong>Domino</strong> Designer is: Windows.<br />
Every operating system has its own boundaries and rules which you should consider<br />
while developing your application. Some of the common factors that vary on different<br />
operating systems and can effect your application are:<br />
Allowed file size<br />
Allowed characters in names<br />
Memory consumption limit<br />
File and folder access control<br />
Possible scalability<br />
Number of connections allowed<br />
Here are some links that can help you determine the differences between various<br />
operating systems:<br />
Comparison of operating systems:<br />
http://en.wikipedia.org/wiki/Comparison_of_operating_systems<br />
Comparison of file systems: http://en.wikipedia.org/wiki/Comparison_of_file_systems<br />
Known limitations of Notes and <strong>Domino</strong> 8 releases: https://www-<br />
304.ibm.com/support/docview.wssuid=swg21308379<br />
61 of 217
For multi platform applications, you should be very careful on how you write your code<br />
because you are bound to run into trouble if you even ignore minor things like how to<br />
access file system on various operating systems.<br />
If you are using external API’s then you should check if there is any dependency on the<br />
operating system in the code.<br />
You should also make sure that you test your application properly on all the supported<br />
platforms and take into consideration both the server and client side of your applications<br />
because you will see some differences in the behavior at both ends.<br />
Your code should be optimized in such a way that it will act keeping in mind an effortless<br />
performance on any platform your application will be running on.<br />
3.5. Application localization<br />
The explosion of the internet has ushered in a new era of business – one without borders<br />
on a multinational global scale. To accommodate the need to communicate effectively<br />
across language barriers, <strong>Lotus</strong> <strong>Domino</strong> gives you many options to take a nativelanguage<br />
application (such as English) and translate it into multiple languages. These<br />
tools include <strong>Domino</strong> Global Workbench, creating individual multilingual design elements,<br />
and XPages localization, all of which are discussed below.<br />
3.5.1 Design considerations<br />
If you wish to deploy a <strong>Domino</strong> application in multiple languages, there are many design<br />
considerations that you must undertake. These include:<br />
<br />
<br />
<br />
<br />
<br />
<br />
The language base that your application will support (such as English, Spanish, and<br />
French).<br />
The level of expertise available to perform the translation of text between languages,<br />
either in-house or through an external translation service.<br />
The complexity of the application.<br />
The development of the application using traditional or XPages-based development<br />
environments.<br />
The scope of the application translation – will it be the entire application that gets<br />
translated, or just certain parts<br />
The frequency of updates to the translated text within your <strong>Domino</strong> application.<br />
Important note: Translation impacts text-based data presented to the user through the<br />
application, and does not include the translation of programming code, menus,<br />
messages, and other items therein.<br />
Once you have a clear picture about the application itself, you have to deploy the method<br />
that is best suit your needs in maintaining a consistent application across multiple<br />
languages, using the tools available for <strong>Lotus</strong> <strong>Domino</strong>.<br />
3.5.2 <strong>Domino</strong> Global Workbench<br />
62 of 217
<strong>Domino</strong> Designer extends itself naturally through an integrated translation tool called<br />
<strong>Domino</strong> Global Workbench. This tool, when installed along side of <strong>Domino</strong> Designer,<br />
gives you the facilities to translate the native application into multiple languages.<br />
Due to the complexity of implementing a <strong>Domino</strong> Global Workbench solution, we outline<br />
the steps here and reference you to the list of items at the end of this subsection for<br />
further information.<br />
Before you begin, it is important to understand the steps involved in managing a<br />
multilingual <strong>Domino</strong> application using <strong>Domino</strong> Global Workbench:<br />
1. You must first setup the application (either in .NTF or .NSF format) with the default<br />
language that you will use to construct the initial application.<br />
2. After the application is designed, you set up a <strong>Domino</strong> Workbench glossary based on<br />
the template DWGGLOSS.NTF that is installed with <strong>Domino</strong> Global Workbench.<br />
3. You then use the WorkBench to construct a database from the original application.<br />
This database, called a tagged database, is identical to the database of the original<br />
application.<br />
4. Within the tagged database, each piece of text that you want to translate is given an<br />
unique identifier (ID), which is linked to an entry in the original application. <strong>Domino</strong><br />
Global Workbench will attempt to create tags for all translatable parts of the source<br />
application that you define. If there is something that it cannot create a tag for, you<br />
can manually create the tag using the workbench.<br />
5. You must now manually translate the tagged text into the target language using the<br />
glossary created earlier and the Notes Client.<br />
6. Now you have the source application, the tagged database, and the glossary, you<br />
build language databases using these components. The language database is the<br />
physical application that the users will access.<br />
7. Once the language databases are created, you can apply the updates by modifying<br />
the original application and the glossary, using <strong>Domino</strong> Global Workbench to push<br />
the changes out to the language applications.<br />
8. In addition, you can configure the Synchronizer, a <strong>Domino</strong> server task that can apply<br />
changes to the language applications automatically.<br />
Important note: While <strong>Domino</strong> does allow translated items to be synchronized across<br />
multiple language applications, you are still required to have the tagged text translated<br />
from the native language into the target languages.<br />
For more information about <strong>Domino</strong> Global Workbench, please visit:<br />
<br />
<br />
<br />
<br />
<strong>Domino</strong> Designer Help (search for “Global Workbench”).<br />
An Introduction to <strong>Domino</strong> Global Workbench 8.5, located at:<br />
http://www.lotus.com/ldd/ddwiki.nsf/dx/Introducing_of_<strong>Domino</strong>_Global_WorkBench_8<br />
.5<br />
Translating a <strong>Domino</strong> Application using <strong>Domino</strong> Global Workbench, located at:<br />
http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsptopic=/com.ibm.desi<br />
gner.domino.main.doc/H_TRANSLATING_AN_APPLICATION_USING_DOMINO_G<br />
LOBAL_WORKBENCH_STEPS.html<br />
Product Documentation that comes with <strong>Domino</strong> Global Workbench.<br />
<strong>Best</strong> practices<br />
To get the most out of <strong>Domino</strong> Global Workbench, consider the following:<br />
63 of 217
Use <strong>Domino</strong> Global Workbench to translate native <strong>Domino</strong> applications into<br />
multilingual format.<br />
<strong>Domino</strong> Global Workbench can translate tagged text at the document level into the<br />
target language.<br />
Have a technical person perform the initial analysis of the native application,<br />
gathering information on what components are to be translated.<br />
Have a translator performs the actual language translation of the items, based on the<br />
information provided to them.<br />
Store the translated information in the glossary database. This allows you to apply<br />
existing translated information to other (new) applications without having to manually<br />
translate the information again.<br />
3.5.3 Design element localization<br />
For many <strong>Domino</strong> web development efforts, it is common to use native design elements<br />
(such as forms and pages) to build web applications, opposed to document-level<br />
application development. These web applications tend to be more static in nature, with<br />
the frequency of changes being minimized.<br />
Localizing design elements permits <strong>Domino</strong> to work in conjunction with the language<br />
settings in your web browser to determine which design element (in what language) that<br />
<strong>Domino</strong> will deliver to you.<br />
If you plan to deploy a <strong>Domino</strong> web application that relies more on design elements than<br />
documents, you can deploy those design elements to support multiple languages in a<br />
straightforward manner, as outlined below by example.<br />
Step 1: Configure the application as multilingual.<br />
This is accomplished through the database properties dialog box, as shown:<br />
64 of 217
The above is establishing a baseline for your application, informing <strong>Domino</strong> that the<br />
application:<br />
<br />
<br />
<br />
<br />
Is multilingual.<br />
The default language is English.<br />
The default region is the United States.<br />
Use Unicode (Universal) sorting by default.<br />
Step 2: Create the default language design element.<br />
For the purposes of discussion, the following assumptions are made:<br />
<br />
<br />
<br />
You want to create a <strong>Domino</strong> web application.<br />
You will use Pages as the key design element in your development.<br />
You want to support the English and German languages.<br />
You can start by creating a new web application with a Home page utilizing the <strong>Domino</strong><br />
Designer page design element, for English language users, as shown:<br />
65 of 217
The important thing to realize is the naming convention used above:<br />
<br />
<br />
The design element name is always different for each design element representing<br />
the same web page in the application. As shown above, the name describes the<br />
page as being the Home Page in the English Language.<br />
The design element alias is always be the same for each design element<br />
representing the same web page in the application. As shown above, Home<br />
represents the home page, and, will be the same across all variations of the home<br />
page in different languages.<br />
66 of 217
Based on our earlier assumptions, you need two home pages – one in English, and<br />
another in German. Therefore, you can create the German language web page as<br />
shown below:<br />
The results of your efforts are shown below:<br />
Step 3: Instruct designer to display the relative design element based on the web<br />
browser default language setting.<br />
Now that you have two pages named Home, you must tell <strong>Domino</strong> which page to display<br />
based on the default language preferences setting in the user’s web browser.<br />
You accomplish this by selecting the page in the <strong>Domino</strong> Designer, and modifying the<br />
multilingual design properties at the bottom of the screen. For example, the Home Page<br />
English page would be set as follows:<br />
67 of 217
And for German:<br />
68 of 217
Important note: Based on the above, <strong>Domino</strong> must have some way of knowing<br />
whether you want to see the English or German version of the Home page when you<br />
access the application from a browser.<br />
This is accomplished using the Browser Language Preference settings (for Internet<br />
Explorer, this is done by accessing the Tools -> Internet Options menu):<br />
The above browser configuration is set to show the German language version of the<br />
page (if available), then the English language version.<br />
Step 4: Populate the design element with the correct language elements.<br />
Now that you have the web page called Home, one designated for English, and another<br />
designated for German, you can now populate each page with its respective text,<br />
graphics, media, and so on.<br />
Consider the following text excerpt from the <strong>Domino</strong> Designer help file:<br />
“The Home Page is a great place to start. This page, which was previously called the<br />
Welcome Page, gives you immediate access to your mail, contacts, calendar, and more.<br />
And you can create new Home Pages, customized to suit your needs."<br />
To make this available to German users, you must translate the text into the German<br />
language, resulting in:<br />
69 of 217
"Das Home Page ist ein großer Platz, zum zu beginnen. Diese Seite, die vorher die<br />
willkommene Seite genannt wurde, gibt Ihnen sofortig Zugang zu Ihrer Post, zu<br />
Kontakten, zu Kalender und zu mehr. Und Sie können die neuen Home Page<br />
verursachen, besonders angefertigt, um Ihren Notwendigkeiten zu entsprechen.”<br />
You copy the respective text onto the correct page, as shown:<br />
If you preview the Home page in browsers set to different default languages, you see<br />
something similar to the following:<br />
You have accomplished the desired goal – to create a design element-based web<br />
application using <strong>Domino</strong>.<br />
70 of 217
<strong>Best</strong> practices<br />
When using design element-based multilingual web applications in <strong>Domino</strong>, consider the<br />
following:<br />
<br />
<br />
<br />
Use design elements for content that is not stored in documents.<br />
Use design element internationalization when the content changes infrequently.<br />
When using design elements, note that the web page that a user will see is based on<br />
their default browser language preferences.<br />
3.5.4 Localization using XPages<br />
As with traditional <strong>Domino</strong> applications, XPages provides a standards-based method for<br />
deploying multilingual XPages-based applications. Unlike traditional design element<br />
duplication, XPages allows you to develop a single source application to be deployed in<br />
multiple languages.<br />
In this section, we show the process for XPages localization and some best practices for<br />
implementing multilingual XPages applications.<br />
3.5.5 Localization in-depth<br />
To localize an XPages application, the high-level steps are:<br />
1. Localization setup: You must know the native (initial) language that the XPages<br />
application will be developed in, as well as configure the application to support<br />
multiple locales.<br />
2. Localization translation: Once your XPages application is developed, you have to<br />
export your native language interpretation and forward them to a professional<br />
translator for translation into the additional languages that your application will<br />
support.<br />
3. Localization implementation: Once you receive your translated information, you<br />
import the results into your XPages application.<br />
Here we discuss these high-level steps in detail by creating an example application using<br />
the <strong>Domino</strong> Designer. You also can use <strong>Lotus</strong> Notes to create an application. Once<br />
complete, open the new application in <strong>Domino</strong> Designer and create the following sample<br />
XPage:<br />
71 of 217
Use these steps to apply the localization to this sample application or your application.<br />
Step 1: Localization setup<br />
You must first configure the application to support multiple languages by enabling<br />
localization, as shown in the following diagram:<br />
From <strong>Domino</strong> Designer, perform these steps:<br />
1. Right-click the application. Select Application -> Properties.<br />
2. Select the XPages tab from the tabs along the bottom of the XPage.<br />
3. Scroll down to enable localization.<br />
4. When done, save your changes.<br />
5. From the Project menu, select the Clean option, then, either manually build the<br />
project, or automatically build the project.<br />
When you enable localization, you must specify the source language (the language that<br />
the application will be developed in), as well as any additional languages you wish to<br />
support (in this example, German).<br />
When you save and close your application, localization is enabled.<br />
Note: The terminology used in the “Localization Options” of the XPages properties differ<br />
slightly for applications developed using <strong>Domino</strong> Designer 8.5.0.<br />
Step 2: Localization translation<br />
Once the application is developed, you are ready to export the localization information to<br />
be translated. This is accomplished as follows:<br />
1. Display the navigator in <strong>Domino</strong> Designer:<br />
If the navigator is not present in <strong>Domino</strong> Designer, you must display it using the From<br />
<strong>Domino</strong> Designer by selecting Window -> Show Eclipse Views -> Navigator<br />
72 of 217
Once complete, your Designer interface should appear similar to the following<br />
diagram:<br />
2. Export the information to be translated:<br />
To physically export the information to be sent for translation, select the following<br />
from the navigator:<br />
a. Right-click the application root.<br />
73 of 217
. Select Export from the menu.<br />
c. The Export dialog box is presented as shown below. In this panel, select<br />
General, then File System. Click Next.<br />
d. In the File system panel (see the figure below), tell <strong>Domino</strong> Designer which<br />
components you want to export by:<br />
o Clearing the checkmark beside the application root.<br />
74 of 217
o<br />
o<br />
o<br />
o<br />
Selecting Resources, then Files.<br />
Selecting XPages.<br />
Check the .properties files on the right side of the dialog box.<br />
Specify a path where the files will be exported to<br />
3. When you click Finish, the files are placed in the directory you specified in a folder<br />
called XPages.<br />
For this example, the following XPages properties file represents the xpSample.xsp file<br />
from the dialog box above.<br />
Note that this is a simple text file. This simplifies the translation process because the<br />
person performing the translation does not require access to <strong>Lotus</strong> Notes, nor to your<br />
75 of 217
environment.<br />
Also note that a reference to each piece of static text on your sample form is presented in<br />
a standard format. This “tagged” file is used by <strong>Domino</strong> for XPage language translation,<br />
and is what you should give to the person performing the translation, who will:<br />
<br />
<br />
<br />
<br />
Open the xpSample_de.properties file. This file will represent the German language<br />
version of the properties file.<br />
Change the text to the right of the = equal sign from its native English to the native<br />
German language.<br />
Save and close the properties file.<br />
Return it to you for importing into your XPages application.<br />
For your sample application, the translated properties file (xpSample_ge.properties)<br />
should appear similar to the following:<br />
The translator saves this file, returning it to you for integration into your XPages<br />
application.<br />
Step 3: Localization implementation<br />
Now that you have your translated properties file, import it back into XPages, as follows:<br />
76 of 217
Before you import your translated property files, prepare the XPages application not to<br />
automatically overwrite the translated property files. This prevents changes to an<br />
application from overwriting your translated property files until you are ready to begin the<br />
export-translate-import process again. Perform the following steps to accomplish this:<br />
1. From <strong>Domino</strong> Designer, right-click the application.<br />
2. Choose Application -> Properties.<br />
3. Select the XPages tab at the bottom of the XPage.<br />
4. Clear the check box “Merge source file changes into property files”.<br />
5. Save your changes.<br />
6. From the Project menu, select Clean...<br />
To import the translated property files, perform the following functions in <strong>Domino</strong><br />
Designer:<br />
1. Using the application explorer, expand the application.<br />
2. Expand XPages.<br />
3. Right-click the properties file you want to import.<br />
4. Select Import.<br />
5. From the dialog box, expand General.<br />
6. Select File System.<br />
The results are shown in the following diagram:<br />
After selecting Next, use the Browse button to locate the translated property files on your<br />
computer. You must also instruct the import wizard to:<br />
<br />
<br />
<br />
Import the relevant translated property files.<br />
Create the folders within the application to hold these files.<br />
When importing is complete, use the Clean option from the Project menu to assure<br />
proper integration of the imported data.<br />
77 of 217
The results are shown in the following diagram:<br />
When you select Finish and confirm the operation, <strong>Domino</strong> Designer integrates the<br />
translated language files into your application. You now have a complete, multilingual<br />
application that functions as follows:<br />
<br />
<br />
<br />
<br />
You access your application through a web browser.<br />
The <strong>Domino</strong> server detects the default language of the browser you are using.<br />
If the application has the relevant localized properties files, the application is<br />
displayed in that language.<br />
If the application does not have the relevant localized properties files, the application<br />
is displayed in the default language.<br />
78 of 217
Your results should be similar to the following:<br />
<strong>Best</strong> practices<br />
When developing localized applications, consider the following:<br />
<br />
<br />
<br />
<br />
If you are using traditional <strong>Domino</strong> applications based on the document model, use<br />
<strong>Domino</strong> Global Workbench.<br />
If you are localizing traditional <strong>Domino</strong> applications based on the design element<br />
model, use design element localization.<br />
For new and modern <strong>Domino</strong> applications utilizing XPages, use the XPages<br />
localization method. The benefits you receive in XPages localization over other<br />
methods include:<br />
o XPages localization is easier to implement than <strong>Domino</strong> Global Workbench.<br />
o Xpages localization is more flexible than design element localization, for you<br />
only have one XPage to modify.<br />
o XPage localization allows translation to be done easily using a text file that is<br />
exported from, and imported into, your XPages application. This eliminates<br />
the need for Notes or <strong>Domino</strong> Designer during the translation process.<br />
o XPages localization is more flexible than other methods, especially when<br />
adding additional languages to an existing application.<br />
When using XPages localization, you should follow these guidelines as a best<br />
practice:<br />
o Make a backup of all properties files – before and after the translation.<br />
o Clean the application after every export and import to assure that XPages<br />
properly integrates your localization changes.<br />
o Clear the checkbox “Merge source file changes into property files” on the<br />
application properties to prevent simple changes from adversely impacting<br />
your translated files.<br />
79 of 217
3.6. Team development considerations<br />
While <strong>Domino</strong> provides an excellent Rapid Application <strong>Development</strong> environment that<br />
allows a single developer to create some great applications, there are projects that<br />
require a team's effort. The most challenging part of working in a team is to communicate<br />
what changes are being made so you do not delete another team member's work. As<br />
with any code development, you should have a place for the team to see who is working<br />
on which design elements and what the changes will be.<br />
Plan your changes to group the changes together into one release. This helps make the<br />
testing easier. For each release, you have to coordinate which design changes can go<br />
forward and which have to be pushed to the next release.<br />
3.6.1 Work locally<br />
Unless you have a really fast development server, it is better to code locally. There is<br />
always a chance that someone else's code might crash the development server and you<br />
can lose your work. Replicate often so you have a backup and you get the changes from<br />
others. For testing the XPage, use the development server, it provides a better test<br />
environment then viewing locally.<br />
3.6.2 Turn on design locking<br />
Replication conflicts between design elements are generally handled be choosing one<br />
"winner" and discarding the duplicates. If the discarded design element contains three<br />
hours of another team member's work, they may not be happy about this. By enabling the<br />
design locking feature of <strong>Domino</strong> Designer, only one developer will be able to work on a<br />
given design element at any given time.<br />
If developers are working in local replicas, this is especially important, since they<br />
normally will not get the message about save conflict unless the other developer's<br />
change has already replicated to their local replica. Design locking does work in local<br />
replicas -- the client will contact the administration server for permission to edit the design<br />
element. If the user can't reach the administration server, they do have the option to do a<br />
provisional checkout and edit the design element anyway; but make sure they know this<br />
is a Bad Idea unless they're sure nobody else is working on that design element.<br />
3.6.3 Turn off automatic project build<br />
By default, project building in XPages applications, is performed automatically when you<br />
save changes. If you need more control over when builds occur, you can disable<br />
automatic building function and manually invoke the build function. The automatic build is<br />
disabled sometime when the building should wait until a large set of changes is finished.<br />
The disadvantage of manual building is that tasks generated to indicate build errors<br />
quickly become out of date until you build again. In addition, it is important to remember<br />
to manually build the project before running those applications that rely on the build<br />
output, for example, before running your Java program.<br />
You can turn on and off this option on Workbench using the action menu Project -><br />
Build Automatically, which is a toggle menu of on and off. If set to on, whenever a<br />
80 of 217
esource is modified, another incremental build occurs.<br />
Alternatively, you can follow these steps to turn on or of the Build Automatically option:<br />
1. Open the File -> Preference -> Workspace page.<br />
2. Select the Build Automatically .<br />
3. Click OK to close the Preferences page.<br />
While the Build Automatically option makes the build process easy, that you do not have<br />
to remember to build to see your changes, it will build all code in the NSF, including<br />
changes others have made. As you make changes to an XPage or custom control, you<br />
can do a Build Project on each design element. Turning off the build automatically option<br />
allows you to shorten the build process and make it faster if you intend to just build the<br />
design elements you need to test.<br />
3.6.4 Use same version of <strong>Domino</strong> Designer for all team<br />
members<br />
When you build an XPage, the build process recompiles anything that was complied with<br />
an older version or fix pack that has controls that have been updated in the newer version<br />
of Designer. This is a real problem if you have Build Automatically enabled since it will<br />
build design elements it thinks needs it. The older version XPage or Custom Control will<br />
now have your name and the current date and time assigned to the design element. It will<br />
look like that you have changed the design element while you had not actually touched it.<br />
When you replicate back to the server, you could overwrite changes made by the<br />
developer using the older version of the Designer.<br />
3.6.5 Assigned code changes<br />
If possible, assign changes by the design elements that will be modified so you do not<br />
have two developers trying to update the same design element. The code libraries give<br />
the best chance of over ridding someone else changes. Code libraries allow you to<br />
centralize your <strong>Lotus</strong>Script, Java, and JavaScript code. As part of the communications of<br />
which design elements are to be change, do not forget to include the code libraries.<br />
81 of 217
3.6.6 Use a third party tool to control the changes<br />
There are tools available to help with controlling the development process. These tools<br />
run from the simple code documentation through to design element check-in and out. The<br />
version 8.5.3 of <strong>Domino</strong> Designer supports using a source version control. This is<br />
discussed in 3.7 Code control.<br />
Visit OpenNTF.org to see what open source tools are available to help you manage your<br />
development.<br />
3.7. Source control<br />
There is no source code control system built into <strong>Domino</strong> Designer in Eclipse (DDE).<br />
However, beginning with version 8.5.3, you can integrate DDE with third party source<br />
control products for Eclipse developers.<br />
3.7.1 Background<br />
All the design elements that make up a <strong>Domino</strong> application are physically stored in a<br />
single NTF or NSF file. Eclipse projects, however, traditionally use distinct files stored on<br />
the file system in one or more subdirectories. DDE bridged this gap by converting a<br />
single NTF or NSF file into a virtual file system so the different design elements can<br />
properly show. Third party source control products rely on physical files instead of virtual<br />
files. DDE 8.5.3 introduces a way to export a virtual file system into physical files and<br />
then automatically synchronize between the two, allowing Eclipse source control products<br />
to work on the physical files.<br />
3.7.2 Exporting an Application<br />
To export an application, perform these steps:<br />
1. Open the application in DDE 8.5.3, then go to File -> Team <strong>Development</strong> -> Set Up<br />
Source Control for this Application. (This menu option is also available when rightclicking<br />
on a database in DDE 8.5.3). The following dialog box appears:<br />
82 of 217
Note: if the menu option is not there on your 8.5.3 install, make sure the database is<br />
open in <strong>Domino</strong> Designer. You might also need to switch to a different Perspective to<br />
make sure the menu option appears.<br />
This first screen of the wizard is an introduction and can be skipped in future setups<br />
by checking the box at the bottom of the dialog box. Click Next.<br />
2. You are prompted to enter a project name. Although this name can be anything you<br />
want, it makes the most sense to use something similar to the file name of your<br />
application. For example, if your template name is “sample.ntf”, then a project name<br />
of “sampleodp” (where “odp” stands for “on disk project”) might be appropriate. The<br />
project name will be the base subdirectory name of your project. It can be stored in<br />
83 of 217
the default location or in another location on disk.<br />
3. After clicking Finish, the project is exported to disk. If you selected the option to open<br />
the navigator view after the export completed, DDE opens the Navigator view. In the<br />
Navigator view, there is the original NTF or NSF (indicated by a <strong>Domino</strong> icon) and the<br />
exported files (indicated by a folder icon).<br />
The exported files are distinct files physically on disk (you can view these files in<br />
Windows Explorer). By default, from this point forward, any changes to the NTF/NSF<br />
in DDE are also written to the files on disk, and any changes to the files on disk are<br />
brought into DDE.<br />
84 of 217
3.7.3 <strong>Domino</strong> Designer preferences<br />
<strong>Domino</strong> Designer preferences control the features of Source Control. These preferences<br />
can be found under the <strong>Domino</strong> Designer -> Source Control preferences.<br />
Use binary DXL for source control operations<br />
If you have previously worked with text-based <strong>Domino</strong> XML (DXL) in the past, you might<br />
know that there is not currently 100% fidelity between the <strong>Domino</strong> design element and<br />
the text DXL representation of the design element. Source Control uses a binary DXL<br />
representation to achieve fidelity between the NTF/NSF and the files on disk. However,<br />
this also means that some design elements are not very “readable” on disk. If you have to<br />
be able to read through the files on disk and are satisfied that your application can fully<br />
use text-based DXL, you can disable this setting. Most developers need this setting<br />
enabled all the time.<br />
Enable automatic export of the design elements (from NSF<br />
to disk) on modification<br />
With this setting enabled, any change made in the NTF and NSF is automatically<br />
synchronized to disk. If this setting is disabled, changes made in the NTF or NSF in DDE<br />
are not written to the file system representation (they are only written to the NTF or NSF).<br />
Enable automatic import of the design elements (from disk<br />
to NSF) on modification<br />
Similarly, this setting controls whether changes to the file system representation are<br />
automatically synchronized with the NTF or NSF in DDE. If the project is not being<br />
automatically synchronized, it can be manually synchronized at any point. Go to File -<br />
>Team <strong>Development</strong> -> Sync with On-Disk Project and the synchronization will be<br />
manually preformed.<br />
85 of 217
Show Helper panel in Set Up wizard<br />
This setting determines whether the first screen of the wizard appears or not. If you<br />
decided to skip the first page of the wizard and want to bring it back, enable this setting in<br />
preferences.<br />
3.7.4 Third party source control<br />
DDE's implementation of source control was designed so that it does not rely on a source<br />
control plug-in for Eclipse from a specific company. Any source control plug-in for Eclipse<br />
should work. If you are unfamiliar with source control products in Eclipse, there is a<br />
DeveloperWorks article describing how to use Subversion (SVN) with Eclipse. .<br />
Note that any source control product you use with DDE 8.5.3 must be compatible with<br />
Eclipse version 3.4.2, which is a back-level version of Eclipse. This means that<br />
sometimes you must download a back-level version of the third party product. You should<br />
check the system requirements before purchasing any source control product.<br />
3.7.5 Removing Association<br />
An NTF or NSF that has been previously exported through Source Control can have the<br />
connection removed. Go to File-> Team <strong>Development</strong> -> Remove Source Control<br />
Association. After confirming the action, the association is removed. This will not<br />
remove the files from disk, but only remove the association between the NTF or NSF and<br />
the files on disk.<br />
3.7.6 Additional Information<br />
Here is additional information concerning the Source Control feature in DDE 8.5.3:<br />
Multiple file system files<br />
If you are viewing the files on the file system, you will notice that some design elements<br />
(such as Forms) have one file on the file system and other design elements (such as<br />
XPages) have two files on the file system. For an XPage design element, one file is the<br />
XML source of the XPage, and the other file is the properties of the XPage (for example,<br />
flags such as “do not allow design refresh/replace to modify”). Some design elements<br />
require two files on the file system, and others can be contained in one file.<br />
Changes not synchronized<br />
There are certain changes that are not considered significant enough to result in a<br />
synchronize to or from the file system. For example, simply opening a design element<br />
and pressing CTRL+S without making any changes might not result in the file system<br />
representation being updated, even though the time stamp on the design element in the<br />
NTF or NSF has been updated. This is expected behavior in DDE 8.5.3. Changes that<br />
are significant should result in the files being synchronized. Similarly, if an insignificant<br />
86 of 217
change is made to the files on disk, that change might not be synchronized back into the<br />
NTF or NSF.<br />
87 of 217
Chapter 4. Coding techniques<br />
When developing in any language/platform, there are many paths to get to the same<br />
destination. Some paths are more efficient than others. While there are few "this is<br />
always the case" rules, there are many guidelines that can assist when deciding which<br />
coding technique to apply in a certain situation. This section goes through various<br />
situations you will encounter in your <strong>Domino</strong> development, and attempts to provide you<br />
with the best practices needed to make your applications shine and perform well.<br />
4.1. Code documentation<br />
Documentation is often overlooked as part of the design process, but should not be. It is<br />
important to have developer documentation, user (functional) documentation, and<br />
administrator documentation. Documentation can be stored anywhere that makes sense<br />
for your application. Some examples of documentation storage:<br />
<br />
<br />
<br />
In the Help -> About This Application and Help -> Using This Application<br />
documents<br />
In a separate Notes application (which can be anything from a discussion database<br />
to a wiki template to a customized design)<br />
In files that are stored as File Resources in the application<br />
Regardless of the location of the documentation storage, it should be easily accessible by<br />
the target audience. For example, users will make use of the About This Application and<br />
Using This Application documents, therefore, if user documentation is stored outside the<br />
application, there should be links to the documentation stored in the About and Using<br />
documents.<br />
4.1.1 Source code documentation<br />
For developer documentation, one easy thing you can do is to use comments in your<br />
code. If you write @-formula code, use the REM statement to include comments. The<br />
formula below includes two comments:<br />
REM { Get the current role for this user from the profile document for the<br />
user, then filter the view to only show the documents under the specified<br />
category };<br />
CurrentRole := @GetProfileField("profUserSettings"; "CurrentRole";<br />
@UserName);<br />
@SetViewInfo([SetViewFilter]; CurrentRole; "FilterCategories"; 1);<br />
REM { To clear filtering -- @SetViewInfo([SetViewFilter]; ""; 0; 1) };<br />
4.1.2 <strong>Lotus</strong>Script comments<br />
If you write <strong>Lotus</strong>Script code, you can add comments in multiple ways:<br />
<br />
<br />
A single quote on a line indicates that the rest of the line is a comment<br />
The REM statement as the first word on a line indicates that line is a comment<br />
88 of 217
Lines between a %REM to %END REM block are all comment lines<br />
The following code block shows a block comment (%REM to %END REM), a single line<br />
comment (REM), and a comment ending a line (single quote):<br />
%REM<br />
Function AreArraysEqual<br />
Created Jul 22, 2004 by Joe Developer/New York/ACME<br />
Description: Take two arrays passed in as input and return Boolean TRUE<br />
if the two arrays have the exact same elements. The elements can<br />
appear in any order, but both arrays must have all the same<br />
elements.<br />
%END REM<br />
Function AreArraysEqual(array1 As Variant, array2 As Variant) As Boolean<br />
REM If the arrays don't have the same number of elements, they aren't<br />
equal<br />
If Ubound(array1) - Lbound(array1) Ubound(array2) - Lbound(array2)<br />
Then<br />
AreArraysEqual = False<br />
Exit Function ' ======== Return to the calling procedure ======<br />
End If<br />
4.1.3 Using comment templates in <strong>Domino</strong> Designer<br />
If you are using the <strong>Lotus</strong>Script editor in Eclipse, available starting in <strong>Domino</strong> Designer<br />
8.5.1, by default, comments are automatically be generated within <strong>Lotus</strong>Script code. The<br />
editor automatically generates comments for new libraries, classes, types, functions,<br />
subs, property gets, and property sets. You can control the content of these comments,<br />
disable automatic comment generation, and manually trigger the creation of a comment.<br />
To control the comment templates, go to File -> Preferences in <strong>Domino</strong> Designer. Then<br />
expand the <strong>Domino</strong> Designer and <strong>Lotus</strong>Script Editor categories and click Comment<br />
Templates.<br />
There is a setting whether comment templates are automatically used or not. If they are<br />
being used, you can dynamically generate content through comment template variables.<br />
For example, the comment template ${date} can be used to include today's date. You<br />
89 of 217
can fine a full list of code and comment template variables in <strong>Domino</strong> Designer help.<br />
Search for "comment template variables" in <strong>Domino</strong> Designer helps to find the list of<br />
variables.<br />
4.1.4 XPage comments<br />
In your XPage development, your comments depend on where your are writing your<br />
code. Inside server side JavaScript (SSJS), use the standard JavaScript comment<br />
identifiers. A set of double slashes (//) indicate that the rest of the line is a comment. This<br />
can be used on its own line or at the end of a statement. To identify a comment block,<br />
that is done with /* at the start of the block, and */ at the end of the block.<br />
Inside the XPage itself, comments are best done using XML comment identifiers within<br />
the XPage source (XPage source code is XML). indicates the end of an XML comment. XML comments can appear<br />
anywhere within the XML source code.<br />
Below are code examples from the XML source and the server side JavaScript.<br />
Example from the XML Source of an XPage<br />
The following code block shows an XML comment () in the XPage source code:<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Choose the server to host the application from this drop-down list.<br />
<br />
90 of 217
Example from the server side JavaScript dialog box<br />
The following code block shows both the JavaScript comment block (/* to */) and the<br />
comment ending a line (//):<br />
/* There are fields holding the month number and year number. Convert<br />
those<br />
values to an abbreviated month name. */<br />
try {<br />
// Build an array of the month numbers<br />
var sourceArr = "1~2~3~4~5~6~7~8~9~10~11~12".split("~");<br />
// Build another array of the month names<br />
var destArr =<br />
"Jan~Feb~Mar~Apr~May~Jun~Jul~Aug~Sep~Oct~Nov~Dec".split("~");<br />
var title = @If(@IsNewDoc(),<br />
"New Report",<br />
"Report for "<br />
+ @Replace(currentDocument.getItemValueString("ReportMonth"),<br />
sourceArr, destArr)<br />
+ " " + currentDocument.getItemValueString("ReportYear")<br />
);<br />
return title;<br />
} catch (e) {<br />
return "";<br />
}<br />
4.2. Using library versus coding in agents or events<br />
4.2.1 Comparing XPages to Java agents<br />
Although you really cannot compare an XPage to a Java agent because of their different<br />
capabilities, understanding the underlying class loaders gives you a general feel for the<br />
performance. In a Java agent, there is a class loader per class each time the agent is<br />
called. This means that even if you request the same Java agent multiple times, there is<br />
no advantage gained the second time the agent is called. Also, if the agent references<br />
multiple libraries, those libraries must be loaded each time. Therefore, a Java agent with<br />
multiple libraries does not perform as well as a Java agent with all the code in a single<br />
class. But, even the Java agent with all the code in a single class is loaded every time<br />
that agent is called.<br />
In XPages, there is a single class loader per instance of the application. It holds the<br />
classes in memory until the database times out (a period of time after the last user has<br />
referenced the application). This means that multiple users of the same application get a<br />
performance gain by sharing the class loader. If you are trying to decide between doing<br />
coding in a Java agent or an XPage, you should choose the XPage.<br />
91 of 217
4.2.2 Using JavaScript Script libraries<br />
If there is client-side functionality that you have to perform in your XPage development,<br />
you should take advantage of JavaScript libraries. You store your client-side JavaScript<br />
code in the library and then reference the functions from your XPage. By developing this<br />
way, you take advantage of both client-side and server-side design element caching. The<br />
client only has to bring down that design element once and then it can use the cached<br />
version on subsequent XPages.<br />
4.2.3 Using server side JavaScript libraries<br />
Whenever possible, you should take advantage of server side JavaScript (SSJS) libraries<br />
instead of coding directly inside the XPage. Even though both the XPage and the server<br />
side JavaScript are compiled, if you are using a server side JavaScript, you are taking<br />
advantage of caching on the server. Multiple people referencing the same XPage do not<br />
have to have multiple versions of the code loaded into memory.<br />
4.2.4 <strong>Development</strong> considerations<br />
Coding in libraries instead of directly in the XPage is also easier for the developer. When<br />
viewing the XPage source, it will not be cluttered up with a lot of JavaScript and server<br />
side JavaScript code. By isolating the code, your XPage source is cleaner and easier to<br />
support. You not only gain performance benefits, but also receive support benefits.<br />
4.2.5 Other considerations<br />
Starting in <strong>Domino</strong> 8.5.2, there is an external servlet engine used by the <strong>Domino</strong> server.<br />
This servlet engine performs very well. If you can take advantage of creating servlets to<br />
be used by <strong>Domino</strong>, this can help your performance because of how servlets are loaded<br />
and maintained in memory.<br />
You can gain performance improvements by taking advantage of web services too. By<br />
using a web service, the amount of code you send to the client is reduced and the logic<br />
happens on the server.<br />
4.3. Using templates<br />
In today’s high productivity business environment, all the application development,<br />
including the <strong>Domino</strong> applications, are expected to deliver consistently effective results in<br />
an optimum manner. In all application development activities, source code development<br />
requires a major labor effort. The Template (.ntf) is associated with Notes and <strong>Domino</strong> as<br />
a mechanism for source code control management processes. It is imperative to manage<br />
the source code using templates to achieve cost effective results in a consistent manner.<br />
The benefits of template are not just limited to the new application development but also<br />
for the enhancement of the existing applications. If your application is identical, or similar<br />
to, an existing template available in your <strong>Domino</strong> application portfolio, the most<br />
convenient way to create a new application is to use that template as your starting point.<br />
This is a common scenario where the new application requires almost all features similar<br />
to an existing template. There could also be some scenarios wherein you need features<br />
92 of 217
to be inherited from a cluster of templates.<br />
The following are scenarios of using templates:<br />
<br />
Application level inheritance:<br />
It is not uncommon that the business wants to deploy several applications that all use<br />
the same code features. However, certain work-groups, for example, a product<br />
quality department, would want to maintain their own set of data to be managed<br />
privately. Instead of maintaining separate copies of application code for each<br />
department, best practice for the development team is to separate the databases for<br />
each department and have the applications that inherit the code or design from a<br />
common master template. This approach allows each work-group to maintain their<br />
private data but share the same code. Any future improvement in the application<br />
features is to be implemented only in the master template. You can configure the<br />
Database (see the figure below) so that the design refresh task would automatically<br />
propagate the changes over to all applications that inherit this template.<br />
<br />
Design level inheritance<br />
It is common for a <strong>Domino</strong> applications in a portfolio to have several common<br />
features and also has its own distinct features simultaneously. The best approach in<br />
using templates in this scenario is as follows:<br />
o The application inherits its design through the database level inheritance<br />
activated in the database property "Inherit design from master template" for<br />
the major functions.<br />
o The additional features in this application could be inherited from more than<br />
one template.<br />
o Create a new master template and have the code inheritance at the design<br />
level that allows certain design elements inherit its code from one template<br />
and others from another template (See the figure below). Such design<br />
elements need to be copied and pasted from the master template to the<br />
application. These design elements would update itself automatically<br />
93 of 217
whenever the design in the master template has been changed.<br />
<br />
Template documentation<br />
Templates are used among work groups and it is important to document each<br />
template clearly. It helps the source code version control management process. All<br />
templates should incorporate documentation. It is a good practice to document your<br />
work especially when you are working with templates that might have many<br />
developers working in conjunction to build the finished product. Using the built-in<br />
documentation that <strong>Domino</strong> provides can greatly enhance your template in the long<br />
run. Examples of built-in documentation include:<br />
o About This Database<br />
This mode of documentation introduces the template to all users. It describes<br />
the purpose of the template, who might use it and when, and the<br />
recommended access control settings for databases created with the<br />
template. The best practice to document about the template in About this<br />
Database is to divide it into two logical sections. The first section list down<br />
the features and functionality that is built-in to this template. It also list down<br />
the version history details (for e.g. Version Name, Number and Date) and the<br />
development team responsible for maintenance of the template. The second<br />
section has the technical details or embedded a technical specification<br />
document. This helps the team members old and new to be aware of the<br />
technical implementation of the design.<br />
o Using This Database<br />
The Using This Database document gives instructions about the usage of the<br />
application and its features. It has to be updated with more focus to the end<br />
user of the application. The document list down the steps and procedures to<br />
carry out the activities to make use of the features offered by the application.<br />
The application information in this section is expected to be the user manual<br />
for the end user training on this application.<br />
94 of 217
4.4. Resource templates for design elements that are<br />
inherited across applications<br />
One effective way to help jump start any new application development work is to have a<br />
repository of generic, well-tested code that performs specific tasks. For example, you<br />
might have a function that prompts the user for a file name and return the name of the<br />
file. Instead of the developer having to write the code using the NotesUIWorkspace class<br />
and do the appropriate testing to see if the user chose a file name or clicked cancel, the<br />
function performs the specific task.<br />
Once you have all these functions built up from your own experience, or from reusing<br />
code found on the Internet or other resources, you need a location to store this code so it<br />
can be quickly retrieved by developers.<br />
4.4.1 Reusable code library<br />
A Notes application can be used to store the reusable design elements. The application<br />
can be either an NSF or an NTF, and should be designated as a template.<br />
95 of 217
It's a good idea to use the comment field of the design element to note that it came from<br />
the code library, and if it is a text-based element (script library, agent, stylesheet) also put<br />
a comment to that effect in the text. This lets later developers know where to go to find<br />
the latest version, and also makes it simple to automatically catalog all design elements<br />
in all applications whose comment fields show them as coming from your repository, so<br />
that you can find out which applications need to be updated when an element in the<br />
repository is updated (assuming you have access to all those templates to scan them).<br />
While it is technically possible to allow the design element in the using template, to<br />
continue to inherit design changes from a repository template, in practice this is rarely a<br />
good idea, since changes to the repository design elements may easily cause<br />
applications that use them to fail if the changes are not done extremely carefully. We<br />
advise extreme caution in letting changes roll out into production applications; as<br />
described elsewhere in this wiki, it's best to retest the application in a copy of the design,<br />
before rolling out changes to production. Developers of some applications may need to<br />
continue using an older version of something until they have adapted their application to<br />
accommodate the change.<br />
For <strong>Lotus</strong>Script libraries, even changes that don't involve adding parameters may cause<br />
calling code to need to be recompiled before it will work with the new version of a library.<br />
You may want to create an accompanying registry database where developers who make<br />
use of a library element, can record that they are using it. This gives you a mailing list of<br />
people to be notified when a master copy of a design element has a new version (and<br />
also lets you see who's contributed the most reused code).<br />
4.4.2 Reusable code library design<br />
In addition to storing the design elements inside the code library application, it would<br />
make sense to include a simple form and view in the design of the code library<br />
application. The form and view would include documentation of the design element, so<br />
developers could easily find the design element they need instead of looking at agents,<br />
script libraries, custom controls, and so forth.<br />
4.4.3 Using code library design elements<br />
NOTE: There's some disagreement on the recommendation here. See the above for<br />
the reasoning why the following is a bad idea, then you decide what's best.<br />
When the reusable code library has been built, developers simply need to copy and paste<br />
the design elements into their application. Choose Yes to the prompt about inheriting<br />
from the Reusable Code Library template name:<br />
96 of 217
By answering “Yes”, the design element inherits bug fixes and other updates to the<br />
original code in the reusable code library template.<br />
4.5. Forms, Views, and XPages coding considerations<br />
Traditionally, <strong>Domino</strong> applications, simple or complex, use of forms and views that are<br />
the classic design elements for building <strong>Domino</strong>-based applications. The form and view<br />
design elements are part of <strong>Lotus</strong> applications since <strong>IBM</strong> <strong>Lotus</strong> Release 1.0. Over the<br />
years, form and view design capabilities are enhanced continuously to keep pace with<br />
the changing business landscape and the technological advancement. Continuing with<br />
the tradition of enhancing the <strong>Lotus</strong> <strong>Domino</strong> platform and strengthening the developer<br />
community ability to efficiently build <strong>Domino</strong> applications with rich features, <strong>IBM</strong> <strong>Lotus</strong><br />
Release 8.5 introduces a wrapper design element, XPages. XPages brings flexibility to<br />
build <strong>Domino</strong> applications because of data and presentation are separated. Data isn't<br />
stored with the XPage. Instead, the XPage is linked to a data source, such as a <strong>Domino</strong><br />
form or view. XPages allows more user interface options and greater control of<br />
appearance with less effort and greater performance efficient. XPages has many built-in<br />
capabilities for building the Web 2.0 rich features in the <strong>Domino</strong> applications. XPages<br />
enable us to develop more performance efficient <strong>Domino</strong> applications with the use of<br />
custom controls.<br />
In this section, we discuss the designing and coding consideration for form, view ,and<br />
XPages in <strong>Domino</strong> application development.<br />
4.5.1 Form design and coding considerations<br />
Using the XPage features is a best approach to develop your <strong>Domino</strong> application data<br />
presentation features with substantially less efforts. It is helpful to have a form to provide<br />
a list of fields for binding data so the documents can be opened from a Notes client. You<br />
also can use the form to calculate the computed fields with field formulas rather than<br />
putting code on the XPages. Refer to 5.3 XPages versus forms for comparison, usage, and<br />
best approach about using both design elements to build <strong>Domino</strong> application.<br />
Consider the following when design and code forms:<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Use tables to align elements on a form. Nested tables give you precise control over<br />
how you present content. In addition, you can use tables to create certain text<br />
effects, such as having text wrap around a picture.<br />
Group related information. Use sections for approvals or other special access<br />
needs.<br />
Use collapsible sections to organize a form and make it easier for users to see the<br />
information they need. Set the section properties to expand the section in one<br />
context and collapse it in another.<br />
Use the div tags to generate sections in your form to provide better control over the<br />
layout formatting of the sections.<br />
Create subforms that group design elements you could use in multiple forms.<br />
When designing multiple forms for an application, locate particular fields, especially<br />
data such as name, department, current date, and due date, in a consistent place<br />
and a consistent order.<br />
Place hidden fields together at the bottom or top of a form. Assign a different text<br />
color to hidden fields.<br />
97 of 217
Computed fields are evaluated from the top down and left-to-right. Place dependent<br />
fields after the fields they depend on. Forgetting this rule is a common source of<br />
problems.<br />
Use centered text at the top of a form only. It tends to get lost when used farther<br />
down on the form.<br />
Use consistent spacing between elements, and avoid crowding the information<br />
together.<br />
Hide elements that users do not need to see when they are editing, reading, or<br />
printing. In particular, hide nonessential graphics while printing; alternatively, provide<br />
a separate read-only form with suitable data layout as a printer-friendly output<br />
option.<br />
Provide actions and hotspots to let users take action quickly. It is a best practice to<br />
make use of HTML markup text to create the action buttons or links powered with<br />
JavaScript code to perform basic user interface validation on the form to be<br />
submitted.<br />
Use anchor links to move to a paragraph within a document. Anchor links, like<br />
named, anchor in HTML pages, allow you to link to a particular area in a long<br />
document. Use anchor links when documents contain a large amount of related<br />
information and want readers to find a particular section. For example, an anchor<br />
link to go to the "Top" of the form.<br />
If a form contains many fields that contain summary data, it might have an impact on<br />
the performance of views because all the summary data has to be loaded as part of<br />
the collection. Even with this in mind, however, you should still try to compute as<br />
much as possible within the fields on the form instead of in the view.<br />
Web browsers interpret the original text font, size, and style. In your design, you can<br />
only approximate the look and size of text, which may appear different to a web<br />
user.<br />
Web browsers ignore tabs, indents, inter-line spacing and layout regions. Use tables<br />
to align form elements. To add graphic interest, add embedded views and<br />
navigators.<br />
Try to take the advantage of computed-for-display fields for those calculations that<br />
do not need to be stored, such as the document created date. This is always<br />
available with the function @Created and can be displayed in a computed-fordisplay<br />
field. Though eight bytes may not seem like a significant savings, however, if<br />
you stored it for every document in a database with 30,000 documents, it begins to<br />
add up very fast.<br />
Check the fields that are calculated and stored based on a constant-value fields.<br />
Use computed-for-display to reduce the total size of a document and thus to improve<br />
performance.<br />
The formulas in fields do not affect server performance because documents are<br />
created on workstations. The validation and input translation formulas can have<br />
performance impact if a user is running on a very slow machine with little memory.<br />
Functions that have impact on performance should be used sparingly. For example,<br />
the @Db functions,@DbLookup and @DbColumn, can significantly affect both<br />
server and workstation performance. When using these functions, it is often a good<br />
idea to create specific views just for that specific purpose, and have the views select<br />
only the document that are absolutely needed by the lookup. Limiting the number of<br />
documents in a lookup view and keeping those views up to date can increase<br />
performance of these functions. Also, use the cache (default) wherever possible.<br />
Minimize the number of summary fields in each document.<br />
Under Design - Document Information, if the field flag is set to SUMMARY, then that<br />
field information is displayable by the view. The view index stores field information<br />
for all summary fields, whether displayed in the view or not, in preparation for<br />
evaluating the selection formula and the fields displayed by the view. All fields other<br />
than rich text fields are summary fields.<br />
98 of 217
The space required for header information for a blank or empty field is approximately<br />
seven bytes. This means that if you have 50 blank fields in 10,000 documents in a<br />
database, there is about 3.5 MB of wasted space.<br />
Use @DeleteField in the input translation formula of editable fields which might<br />
remain blank. If the field is called SubjectLine, the formula would be as follows:<br />
@If(SubjectLine = ""; @DeleteField; SubjectLine)<br />
<br />
In most formulas, Notes treats a nonexistent field the same way it would treat a<br />
blank or empty field; therefore, although you do sometimes need to code around<br />
these fields, it is no more coding than you would have to do for the cases where<br />
these fields were empty or blank.<br />
Determining when to use subforms<br />
To simplify the maintenance of your design, create subforms containing elements such<br />
as specific section (approval, banner, and so on), actions, fields, and formulas or scripts<br />
that you can share across many forms. You can also group shared fields, which in<br />
themselves streamline your application on a subform. You can then make a design<br />
change once and automatically update all the forms that use that design element. While<br />
subforms simplify form maintenance, loading subforms can slow the opening of<br />
documents slightly.<br />
Determine when to use collapsible sections<br />
Use collapsible sections to:<br />
<br />
<br />
<br />
Make a form shorter and more modular.<br />
Control user access to parts of a form.<br />
Provide complex user interface objects that, if rendered directly on the form, would<br />
slow down the opening of documents created with the form. Use iFrame to load such<br />
section, it helps divide the load of form section-wise on demand when user expands<br />
the section for first time.<br />
Performance consideration of forms<br />
A form that calculates formulas quickly opens the documents created with the form<br />
quickly. To improve form performance, do the following:<br />
<br />
<br />
<br />
<br />
Limit or eliminate shared fields or subforms on any form that must open quickly.<br />
Architecturally, shared fields are on a different note and <strong>Domino</strong> must make extra<br />
internal function calls (a NoteOpen) to get the value of the shared field -- one<br />
NoteOpen call to get the document, another NoteOpen call to get the form, and third<br />
one to get each of the shared fields. However, you should still consider using these<br />
design components in the form to gain the benefits of ease in maintenance over the<br />
slight delay.<br />
Limit the number of fields on the form to the minimum required to have a lean, clutterfree<br />
form with better response time in opening documents.<br />
Remove infrequently used items from a form. For example, redesign your application<br />
to display infrequently used items in a dialog box.<br />
99 of 217
Minimize the number of fields on each form because each field is calculated when a<br />
document is opened, refreshed, or saved. After your design is complete, run an agent<br />
to remove any blank and unused fields.<br />
Avoid over usage of hide-when formulas on forms. Each formula that must calculate<br />
when a form opens slows your application down. Before you use a hide-when<br />
formula, try using a computed subform or a hide-when condition such as "Hide when<br />
editing" or "Hide when reading." If you have Web-only or Notes-only forms, give them<br />
the same name and use the Design Properties box to hide them from the<br />
inappropriate audience.<br />
Make use of computed-for-display fields to calculate the hide-when computation only<br />
once and use this field at all the places in the form. This helps reduce the number of<br />
computation for the server thereby helps improve the forms performance.<br />
Web form performance considerations<br />
The following table shows tips for improving web form performance:<br />
Improving the performance of lookup formulas<br />
@DbLookups and @DbColumns are extremely useful, however, they can be quite a<br />
performance drag on a large application. Keep the following in mind when creating<br />
applications that use @DbColumn, @DbCommand, and @DbLookup to search for and<br />
retrieve information from databases. Use these rules of thumb to minimize the cost of<br />
your @Db functions:<br />
<br />
Minimize the number of @Db functions in any document.<br />
If there is a standard group of fields that are returned through @DbLookup, use one<br />
@DbLookup to return a set of values (which contains a list of the contents of all those<br />
fields), and then parse that field out in your document. If the look-up is required to<br />
fetch multiple field or column values for the same key, use the following approach to<br />
minimize the number of @DB functions:<br />
o Make lookup views with computed column to list the values of multiple fields<br />
using a separator:<br />
100 of 217
EmpName + “~” + EmpDept + “~” + EmpDOJ + “~” + EmpLocation + “~” +<br />
@Implode(EmpSkills; “^”)<br />
Here the “~” character is the field separator and the “^” character is the multivalue<br />
separator of a particular field.<br />
<br />
<br />
<br />
<br />
<br />
<br />
o Use a combination of @DBLookup, @Word, and @Explode formula<br />
functions to perform single lookup and split values of separate fields.<br />
Using this approach for @DBColumn you have to be cautious to anticipate<br />
the amount of look-up data to be fetched in real business scenario. It should<br />
not exceed the 64K data limit for formula look-up.<br />
Have @Db functions refer to small, external databases with minimal design<br />
elements.<br />
Perform look-up on column numbers rather than field names if performance is more<br />
important than easy code maintenance. Looking up a view value is faster, however,<br />
keep in mind that if the column position changes during a view redesign, you will<br />
need to change all formulas that reference the column.<br />
For documents that are often just read (as opposed to almost always being edited),<br />
you should use @IsDocBeingLoaded or @IsDocBeingSaved as part of the formula,<br />
or use AJAX capabilities to look up the data on demand with a button clicking or a<br />
user triggered action.<br />
Use the Cache argument in @DB functions whenever possible if the look-up value<br />
does not change frequently.<br />
Perform look-up on hidden views that have a minimum amount of data.<br />
Avoid redundant look-up in a formula by setting a temporary variable for the first<br />
instance of a returned value and then referring to the variable for the rest of the<br />
formula. Alternatively, use a computed-for-display field to calculate the computation<br />
once and re-use this field reference wherever applicable in the form.<br />
Generating HTML for hidden fields<br />
Enabling the "Generate HTML for all fields" forms property generates HTML information<br />
about hidden fields on a form. This allows the document behavior in a web browser to<br />
match the document behavior in a Notes client more closely. For example, if you create a<br />
form that relies on a hidden field for a calculation, that form may not behave as expected<br />
on the web. By generating HTML for the fields, the information is available for <strong>Domino</strong> to<br />
complete the calculation successfully. The HTML generated for the hidden fields is also<br />
accessible through JavaScript, so you can change the value or find out the state of a<br />
hidden field using a script.<br />
To generate HTML for hidden fields, use these steps:<br />
1. Open the form properties box.<br />
2. Click the Defaults tab.<br />
3. In the "On Web Access" section, check Generate HTML for all fields and uncheck<br />
Treat document contents as HTML.<br />
Cautions:<br />
<br />
Checking this option creates larger files on the web, and may degrade application<br />
performance.<br />
101 of 217
Consider security, since information in hidden fields, though not visible in the<br />
browser, is visible through the "View Source" menu item on the browser.<br />
Using hidden fields<br />
Most forms, in both Notes and the web, include hidden fields that pass constant values.<br />
On the web, the hidden input fields include the tag "type=hidden." If your application will<br />
be used from both Notes clients and web browsers, and you want hidden fields to<br />
perform consistently in both clients, you must follow these steps:<br />
<br />
<br />
<br />
Do not put "type=hidden" into the HTML Body Attributes objects of the hidden fields.<br />
Make sure that you select Use JavaScript when generating pages in the database<br />
properties.<br />
Select Generate HTML for all fields on the form properties.<br />
<strong>Domino</strong> will generate HTML hidden input elements for most hidden fields. This allows<br />
JavaScripts to have access to all the Notes fields in the form, and makes debugging<br />
easier by allowing all the fields to be included in the HTML source code for the<br />
document. The fields of type text, number and time and their range/list equivalents are<br />
supported. The composite field type is not supported. Several other specialized field<br />
types are also not supported for security reasons, for example, No HTML INPUT<br />
statement is generated for password fields, "$Updatedby", "$Htmlhead" , or the section<br />
fields associated with controlled-access sections. Item values that contain NULLs are not<br />
output either because there is no way to express them in HTML. User public keys fall into<br />
this category of objects.<br />
If you have selected "Use JavaScript when generating pages" in the properties box of a<br />
database and you want to use hidden fields on a form in that database, you must also<br />
select "Generate HTML for all fields". It is not necessary to set each field "HTML Body<br />
Attributes" property to "type=hidden". These settings helps in debugging and they must<br />
be on if using JavaScript to refer to a hidden field.<br />
Note: Enabling JavaScript and HTML generation for all fields should not be used if you<br />
are hiding fields for security reasons. A web browser view source function will display the<br />
field contents.<br />
Using a file upload control instead of adding attachments<br />
in a rich text field<br />
The rich text fields in applications intended for the web cannot be used for attaching files<br />
to the document as they can in Notes. If a user attempts to attach a file, the file will simply<br />
be dropped when the form is transmitted from the browser to the server. If you want<br />
users to be able to make attachments, create a file upload control in the form. If the<br />
application is used from both the Notes clients and the web browsers, add an additional<br />
rich text field to be used for attachments from Notes clients, set the hide/when properties<br />
of the upload control and the rich text field to display the proper client.<br />
Passing hidden field values to the browser<br />
To pass on information about a web document, such as its current state, the Notes<br />
document ID, and other variable information, include the hidden field values in the form<br />
used to create the document. These values are returned to the server when the web user<br />
102 of 217
submits the document. Create a hidden value by adding an editable text field and hiding it<br />
with an HTML field event. The document must be in the edit mode for this technique to<br />
work. The steps are as follows:<br />
1. Create an editable text field on the form that will be used for creating documents.<br />
2. In the HTML Attributes field event, enter TYPE=HIDDEN.<br />
3. Select Hide paragraph when document is opened for reading in the Hide tab in the<br />
Field Properties box.<br />
4. Write an agent that generates the field value and run the agent from a WebQueryOpen<br />
form event.<br />
5. Write an agent that saves the field value and run the agent from a WebQuerySave<br />
form event.<br />
Note that this is not a security feature. Users can see the field value when they view the<br />
document HTML source code.<br />
You should write agents instead of using a computed field because:<br />
<br />
<br />
<br />
If neither of the "On Web Access" property options for the form are selected, the<br />
hidden values are not returned to the server by the browser.<br />
If "On Web Access: Treat document contents as HTML" is selected, <strong>Domino</strong><br />
performs no computation on the form. The computed field is ignored when the form is<br />
passed to the browser as HTML.<br />
If "On Web Access: Generate HTML for all fields" is selected, <strong>Domino</strong> converts<br />
computed fields to HTML text when it sends a document to the browser for display.<br />
Only editable fields (not HTML text) are returned to the server when a user submits a<br />
document, so the hidden values are not returned to the server.<br />
The reason that we do not use the use "Hide paragraph from Web browsers" property is<br />
that when the field property "Hide paragraph from Web browsers" is selected, <strong>Domino</strong><br />
skips the field when it converts the document to HTML and the field is unknown to the<br />
browser. To make a field known to the browser without letting the web users see it, you<br />
must use HTML to hide the field.<br />
Making field names and values in HTML difficult to find<br />
The only way to make hidden fields accessible to JavaScript is to set the form property to<br />
"Generate HTML for all fields". However, this feature will expose field names and item<br />
values that were not exposed before. The only way to keep the hidden field names and<br />
values hidden is to not enable JavaScript and HTML generation. The browser's "View<br />
Source" command displays the HTML code, including field names and values, that make<br />
hacking easier. You cannot turn this off, however, you can make it more trouble for the<br />
hacker to capture the code by keeping the pages out of the browser cache, which<br />
normally holds pages and forms even after exiting the browser. You can write the<br />
tags within the page's tag to set the page to expire on a date that has<br />
already passed, and use the Pragma parameter to tell the browser not to cache the file.<br />
Put this into the "HTML Head Content" object for the form:<br />
"”<br />
103 of 217
Attachments links in sections of a web form<br />
In Notes client interface, you can place a rich text field is placed in various sections and<br />
categorize the attachments to a specific section. However, in the <strong>Domino</strong> application for<br />
web browser, the files are uploaded using file upload control, the files are attached to the<br />
document and not associated with any specific rich text field. The association of the<br />
attachment with the section is thereby lost. Considering a business requirement to<br />
display the links of attachments specific to a section from that the document is uploaded.<br />
The following approach helps you overcome this limitation and provide the attachment<br />
links in a specific section:<br />
<br />
Assign an ID to the File Upload Control (see the figure below). This ID is for the<br />
JavaScript code to identify the file attachment selected for upload through the<br />
respective file upload control. Store the names of file attachments uploaded through<br />
this file upload control in a dedicated field that indicates the association of the<br />
attachment with the section.<br />
<br />
<br />
Use the attachment names in the dedicated field to generate the attachment links in<br />
the respective sections.<br />
Check to ensure the valid attachment names are recorded in the dedicated<br />
attachment names field:<br />
onKeyPress='alert("Click on the Browse button to add a file.");return<br />
false'<br />
<br />
Capture the Ctrl key and mouse right-click event to avoid junk data entry in the file<br />
upload control. The check for duplicate attachments name should also be put in place<br />
to restrict upload of such attachment, to avoid loss of the association with section due<br />
to the automatic change in attachment names by <strong>Domino</strong> for duplicate attachments.<br />
Understanding the META tags<br />
You can use the tags in many ways to enhance your site, ranging from<br />
identifying the creator of a page to what HTML specifications the page follows to<br />
preventing browsers from caching pages. HTTP-EQUIV and NAME are two commonly<br />
used attributes in tag:<br />
104 of 217
HTTP-EQUIV attribute<br />
The HTTP-EQUIV attribute of the tag is the equivalent of an HTTP header.<br />
To understand what a header is, you need to know a little about what actually goes<br />
on when you use your web browser to request a document from a web server. When<br />
you click on a link for a page, the web server receives your browser request through<br />
HTTP. Once the web server has made sure that the page you have requested is<br />
indeed there, it generates an HTTP response. The initial data in that response is<br />
called the "HTTP header block." The header tells the web browser information that<br />
might be useful for displaying this particular document.<br />
Similar to the normal headers, the HTTP-EQUIV values usually control or direct the<br />
actions of web browsers, and are used to further refine the information that is<br />
provided by the actual headers. The HTTP-EQUIV values are designed to affect the<br />
web browser in the same manner as normal headers. Certain web servers may<br />
translate META HTTP-EQUIV values into actual HTTP headers automatically so that<br />
the user's web browser would simply see them as normal headers. Some web<br />
servers, such as Apache and CERN httpd, use a separate text file that contains<br />
meta-data. A few web server-generated headers, such as "Date", might not be<br />
overwritten by the tags, but most will work just fine with a standard web<br />
server.<br />
NAME attribute<br />
The tags with a NAME attribute are used for the meta-data types that do not<br />
correspond to the normal HTTP headers. Note that certain search engine agents<br />
(worms and robots) interpret tags that contain the keyword attribute whether they are<br />
declared as "name" or "http-equiv".<br />
Using tags<br />
The tags should always be placed in the HTMLHead event of your <strong>Domino</strong> pages and<br />
forms to ensure that they appear before the tag. This is very important with<br />
framed pages and is frequently missed in the individual framed pages.<br />
One of the examples in implementing tags in a <strong>Domino</strong> application is to prevent<br />
web page caching in users browser so the users will always see the updated pages. By<br />
using the tags, you can tell the browser not to cache files as well as when to<br />
request a newer version of the page. The following are attributes that can be used to<br />
prevent browser caching problem for dynamic data presentation in <strong>Domino</strong> applications:<br />
<br />
Expires<br />
This tells the browser the date and time when the document will be considered<br />
"expired." An illegal date such as "0" is interpreted by the browser as "immediately."<br />
Dates must be in the RFC850 format (GMT format), for example:<br />
<br />
<br />
Pragma<br />
This is another way to control browser caching. To use this tag, the value must be<br />
"no-cache". The following example use two tags together to keep your content<br />
current.<br />
<br />
105 of 217
Note that many users have reported that Microsoft Internet Explorer refuses the<br />
tag instructions but caches the files anyway.<br />
<br />
Refresh<br />
This value specifies the time in seconds before the web browser reloads the<br />
document automatically. Alternatively, it can specify a different URL for the browser<br />
to load.<br />
<br />
Be sure to remember to place the quotation marks around the entire value of the<br />
CONTENT, otherwise, the page will not reload at all.<br />
<br />
Set-Cookie<br />
There are a variety of ways to implement cookies into your application, this is one<br />
method of setting a cookie in the user’s web browser. If you use an expiration date,<br />
the cookie is considered permanent and will be saved to disk (until it expires),<br />
otherwise, it is considered valid only for the current session and is erased upon<br />
closing the web browser.<br />
<br />
<br />
Window-target<br />
This one specifies the "named window" of the current page, and can be used to<br />
prevent a page from appearing inside another framed page. Usually this means that<br />
the web browser will force the page to go to the top frame set.<br />
<br />
<br />
Keywords and description<br />
These allow the search engines to easily index your site pages using the keywords<br />
you specifically tell it, along with a description of your site. The "keywords" attribute<br />
tells the search engines which keywords to use, for example:<br />
<br />
106 of 217
"Description" lets you add your own description of the page for the search engines to use:<br />
<br />
Make sure that you use several of your keywords in your description.<br />
Tip: When using the keyword and description, you can have the same description<br />
enclosed in the comment tags so the web search engine crawlers, spiders, and robots<br />
can obtain your keywords to update their search engine index for faster search. To do<br />
that, just use the regular comment tags, like this:<br />
7. Evaluate the $$Return field -- if it exists and if a save agent did not produce output.<br />
8. Display output to the browser:<br />
<br />
<br />
<br />
If there is a save agent that returns output, return that output to the browser. The<br />
output could be an HTML page created by the agent or a page to which the<br />
agent redirects the user by issuing a URL.<br />
If there is a $$Return field that returns output, return that output to the browser.<br />
Otherwise, return the default message "Form processed" and return to the view<br />
the user came from.<br />
Improving performance when redirecting users to another<br />
<strong>Domino</strong> URL<br />
When a $$Return field or a WebQuerySave agent generates a URL to display the next<br />
appropriate page or document, such URL is known as a redirection URL. The normal<br />
sequence of events for processing redirection URLs is:<br />
1. The browser submits the HTML form to the <strong>Domino</strong> server.<br />
2. The server evaluates the $$Return formula or runs the WebQuerySave agent to<br />
produce the redirection URL, for example:<br />
"[mydb.nsf/viewOpenView]"<br />
3. The server sends the redirection URL back to the browser.<br />
4. The browser accepts that URL as input and makes the request for the URL from the<br />
server.<br />
5. The URL goes back to the server to process the request.<br />
6. The server sends the result of that request back to the browser.<br />
The process described above involves two round trips from the browser to the server. If<br />
the redirected URL references a database on the same <strong>Domino</strong> server, you can avoid the<br />
extra trip back to the server (and therefore, improve response time) by using double<br />
brackets "[[ ]]" around the URL. The server recognizes this as an internal redirection URL<br />
and the transaction sequence becomes:<br />
1. The browser submits the HTML form to the <strong>Domino</strong> server.<br />
2. The server evaluates the $$Return formula or runs the WebQuerySave agent to<br />
produce an internal redirection URL, for example:<br />
"[[mydb.nsf/viewOpenView]]"<br />
3. The server recognizes the URL as an internal redirection URL, evaluates the request,<br />
and sends the results of that request back to the browser.<br />
Using CGI variables to collect information about users<br />
Common Gateway Interface (CGI) is a standard for connecting external applications with<br />
HTTP servers. When a web user saves or opens a document, <strong>Domino</strong> stores information<br />
108 of 217
about the user in CGI variables. If a field exists with the name of a variable, <strong>Domino</strong><br />
passes the information to the field. For example, a field named Remote_Addr uses the<br />
Internet Protocol (IP) address of the user as the field value. The ability to use CGI<br />
variables is useful in computed-for-display fields and for determining hide-when<br />
conditions based on CGI variables. Hide the field during editing, so users cannot enter<br />
information in it.<br />
Tips for making maintenance easier<br />
Maintaining a large application can be time-consuming. Here are some tips that can<br />
lighten the burden:<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
In <strong>Domino</strong> applications, the webmaster, administrator, or system support who must<br />
keep the lists or keywords up to date should have the Editor Access authority or<br />
appropriate roles in the database ACL for editing the documents in your look-up<br />
database. They can then add, delete, and modify the lists that your @Db functions<br />
utilize. This helps to save time of development team to maintain the lists in the<br />
application or to update the hard-coded lists.<br />
Minimize the number of design elements. Do not create redundant or duplicate<br />
design elements because as the number of elements increase, the maintenance cost<br />
increase too. For example, a change in business rules that requires to modify a<br />
complex field formula in several forms and views. Instead, always have a practice to<br />
use shared fields, shared columns, functions in script library, subforms, and other<br />
shared resources to minimize the maintenance efforts.<br />
Document formulas: The complex formulas in the form events, fields, actions, hidewhen<br />
and so on, should be written with proper spacing, with tabs and new line to<br />
make the formula eminently more readable, easy to understand, and easy to<br />
maintain.<br />
Document fields: Use hidden text in the form to add a couple of lines just above or<br />
below each section of your form to document what the fields in that section are used<br />
for.<br />
Restrict access to groups: Create group names and place them in the public directory<br />
and in your access control list (ACL). When granting access to someone new in your<br />
company, simply add their name to the group record in the <strong>Domino</strong> directory. There<br />
is a field called Description which can be used as a reminder as to why someone has<br />
been granted access.<br />
Limit delete access to reduce the number of deletion stubs. In most applications,<br />
documents should not be deleted frequently. If users have to delete documents from<br />
your application, find out why. Make sure that the users understand well how to use<br />
your application by providing good training and documentation. Also make sure that<br />
the document deletion is not a result of a design flaw.<br />
Take the advantage of the Help to make the application self-documenting. Create<br />
field help. Use the Help About and the Help Using documents. If necessary, create<br />
a Help view and Help documents.<br />
4.5.2 View design and coding considerations<br />
When designing views, keep in mind that there are several steps that you can take to<br />
increase performance.<br />
First, try to use less complex formulas. For example, performing calculations on field<br />
values in column formulas is not as efficient as doing the calculation in a field on a form,<br />
109 of 217
thus, making the column formula very simple. The same holds true for selection formulas,<br />
and especially for selection formulas that use Time and Date functions, which render the<br />
view index out of date constantly. Reducing the complexity of the formulas contained in a<br />
given view design can significantly improve the performance of that view. The more<br />
documents in a view, the more noticeable change you are likely to see.<br />
Unread marks have a performance impact on views. Try to use unread marks only in<br />
those views that are really needed. If you do have to use them, remember that using the<br />
option "Unread Documents only" is more efficient than "Compute and Display at all levels<br />
of View".<br />
Restricting readership of individual documents by using a Readers field or Privileges also<br />
has an impact on view performance. (Restricting access to the entire view has no<br />
impact). In case of Notes client based application, if you must restrict access to<br />
documents, use views such as "Shared to Private on first use " that can select only those<br />
documents that can be seen by the user, instead of collecting all of the documents for all<br />
users in a single view.<br />
Every time a document is composed, deleted, or updated, Notes has to flag every view<br />
whose selection formula contains that document. Those views are now out of date, and<br />
have to be refreshed by the next user who enters the view or by the <strong>Domino</strong> server when<br />
it next indexes the view. The more views that require update, the more often a user will<br />
be in the position of refreshing a view when opening it. Also, more views means more<br />
time for the indexer to run when it updates the indexes of all views in the database.<br />
Note: Views and folders that must be refreshed to remain current. The more views you<br />
have, the more work is required by the server to refresh these views.<br />
It is possible to split a database onto multiple servers, and have different views on the<br />
different servers. For instance, the read-only views could be on the database of the<br />
Statistics, Printing, Searching, and Manager replica. The working views could be on the<br />
database of Users replica. The two replicas would see each other as Editors only, so<br />
that they would not trade view design. The Users database would constantly be updating<br />
because of user traffic. However, with the Managers' views taken out, there would be far<br />
less updating to be done. Furthermore, managers are not even accessing this copy of<br />
the database, so that eliminates the authentication process of that user group. The<br />
Managers' copy would only be updated after replication. Because the Manager server<br />
probably has a much smaller user base and thus less authentication and indexing are<br />
required, you can set the replication of the User and Manager databases to take place<br />
only on the Manager server and run indexer only after the replication cycle.<br />
You also can set up the views as 'Shared', 'Private on First Use', or 'Private'. For these<br />
view type, the indexes are stored locally on the users' desktop.dsk files. hese views have<br />
slower performance than regular shared views. Depending upon the size of the view<br />
index, the users might find that their desktop.dsk files grow alarmingly.<br />
Minimizing the complexity of views<br />
<strong>IBM</strong> <strong>Lotus</strong> offers great tools for tailoring views. Use these facts to help you make<br />
decisions about what kinds of views to make:<br />
<br />
Minimize the number of columns with formulas. It is more efficient to have a formula<br />
calculated in a field in the documents, and then simply display that field value in a<br />
view column.<br />
110 of 217
Sorted columns and categorized column take longer to index than non-sorted<br />
columns. You might experience a noticeable slowdown in indexing time after adding<br />
a sorted or categorized column to a view that had no sorted or categorized<br />
column. Each additional sorted or categorized column increases the indexing time,<br />
though progressively less.<br />
The size of the view index has a direct relationship to the number of columns and the<br />
number of documents.<br />
Documents appearing in multiple categories increase the size of the view index<br />
considerably. For example, for the users who use All By Category and All By Person<br />
views, the view index mail file size of All By Person view categorized on all recipients<br />
is significantly larger than the mail size of the All By Category view index.<br />
Avoid using form formulas whenever is possible. Computed subforms are the faster<br />
alternative. However, consider the maintenance aspect in case of the complex form<br />
structure and the number of fields in the form.<br />
The more information contained in the SUMMARY fields, the larger the view index.<br />
Refer to 6.1 View index performance considerations for more specific information on view<br />
index performance.<br />
Structuring view selection formulas to improve<br />
performance<br />
The way the selection formula of a view is written can impact the performance of your<br />
application. If all documents in a view use the same form, for example, use that form<br />
name in the view selection formula. Notes scans only the documents created with that<br />
form, not the documents created (or edited and saved) with other forms.<br />
For example, in a view with hundreds of documents, but only a few that include the field<br />
"Company", the formula<br />
SELECT form = "Main" & company = "Acme"<br />
would be more efficient than<br />
Select company = "Acme"<br />
if the "Company" field exists only on the "Main" form. This will provide the biggest<br />
performance gain when the selected documents represent a small subset of the entire<br />
database.<br />
Tips for developing web views<br />
Although you can include a view or folder in a web application, you have little control over<br />
its presentation in a browser. Views or folders always display in a full screen with default<br />
navigation buttons.<br />
You can regain some control over how the view displays if you embed it in a form, page,<br />
or document. You can maintain the same functionality available in Notes applications,<br />
and you can control the size and appearance of a view or folder display. You can also<br />
111 of 217
combine view and folder panes with other form elements (such as styled text) and<br />
graphics.<br />
When you embed a folder pane, you show a list of views and folders with the standard<br />
Folders navigator, as seen in Notes with the view - show folders command. The font<br />
style you apply to the field applies to the style used to display the folders.<br />
If you have multiple views or folder panes you want to display in an application, you can<br />
create one or more view templates that control how the embedded objects display. A<br />
view template is actually a specially named form that provides the design structure for<br />
displaying the embedded folder panes or views in an application.<br />
<br />
<br />
<br />
Use a form as a view template to customize the view and make it look more web-like.<br />
Use only minimum required columns for the web views.<br />
By default, views show 30 rows at a time. You may want to vary this number by using<br />
the "Default lines per view page" setting in the <strong>Domino</strong> server document of the Public<br />
Address Book.<br />
Use these tips to improve view performance on the web:<br />
<br />
<br />
<br />
<br />
Avoid cascading views because the screen has to be redrawn and the page appears<br />
to jump.<br />
Remove all unnecessary columns.<br />
Do not use form formulas to display documents to web users. Instead, use computed<br />
subforms that are hidden from Notes users to show Web-only information.<br />
Avoid time-sensitive column formulas that use @functions such as @Now,<br />
@Created, and @Modified. <strong>Domino</strong> generates web views as HTML pages on the<br />
fly. Time-sensitive formulas recalculate each time a web user takes an action in the<br />
view.<br />
For example, if you want a "What's New" view for a web site, do not create a view<br />
selection formula that checks to see if every document's created date is within seven<br />
days of @Now. Such a formula would force the view to be dynamically regenerated<br />
every time the user interacts with it. Instead, in each document, set a flag in a hidden<br />
field to either a 1 or a 0 depending on whether the created date falls within seven<br />
days of the current date. (This is the most convenient approach, but could result in<br />
the unnecessary replication of documents as the flag gets reset. If the database is<br />
being replicated, you might use a <strong>Lotus</strong> Script agent to move documents in and out of<br />
a folder that holds only the most recent documents.)<br />
Scrubbing a view affects performance<br />
Active databases that let users create and reassign categories to documents can<br />
accumulate empty categories that contain no documents, yet clutter categorized views.<br />
You should be aware of the performance implications of reducing this visual clutter.<br />
Selecting "Don't show categories having zero documents" on the View Properties box<br />
causes <strong>Domino</strong> to take additional steps to test each category in the view to determine<br />
whether it includes documents. As an alternative to adding processing each time a view<br />
is refreshed, consider proactive removal of empty categories with a timed agent, or<br />
tighter control of the creation of categories in the database.<br />
Use single-activity view<br />
A single-activity view helps users focus on the tasks for an occasional activity, such as<br />
archiving or printing, and maintains instructions in one place. Use the view action bar to<br />
112 of 217
walk the user through all necessary tasks the same way you walk a user through the<br />
process of filling out a form. To enhance the view, create a companion navigator that<br />
includes a text object containing instructions.<br />
Predetermine view categories<br />
Applications that allow users to specify view categories become confusing when users<br />
add too many categories and do not keep them consistent. It is a good practice to plan<br />
categories in advance.<br />
When creating the Categories field, enter a text list of categories or use a look-up formula<br />
to provide categories. To give users some flexibility, enable the "Allow values not in list"<br />
option so that users can add custom categories.<br />
Improving view and folder performance<br />
<br />
<br />
Reduce the number of views and folders to improve database performance.<br />
Avoid writing selection formulas or view column formulas based on a date calculation.<br />
This causes performance lag because the calculation must be done every time the<br />
view is opened. For example:<br />
SELECT @today
Using $$ViewTemplateDefault as a deterrent<br />
Almost every <strong>Domino</strong> application uses hidden views for look-ups and other necessary<br />
events and processes. These hidden views cannot be secured to prevent user accessing<br />
had the user knows how to reconstruct the <strong>Domino</strong> URL to view the data. For this<br />
reason, it is a good practice to use the $$ViewTemplateDefault form as a shield to deter<br />
users who might attempt to gain access to the areas of your application that you do not<br />
want the user to see. This technique requires a little extra work from the developers<br />
because for every view in your application, there is a view template required. On your<br />
$$ViewTemplateDefault variable, it is possible to capture the names of the users who are<br />
attempting to access your application, by using hidden fields that calculate the<br />
@Username formula or some CGI field value.<br />
Caution: This technique is not a true <strong>Domino</strong> security implementation.<br />
Make DHTML views for web users<br />
It is the best to use the XPages view to provide rich Web 2.0 features that are faster and<br />
easy to build with better GUI. However, if you are not using the XPages, then consider<br />
DHTML views as an option for displaying views in a web application. This type of view<br />
consists of an embedded view surrounded by DHTML code. Follow these steps to create<br />
a DHTML view:<br />
1. On the Advanced tab of the view properties box, in " Web Access” section, select<br />
Treat view contents as HTML.<br />
2. The view should have the column formulas with embedded HTML code that use field<br />
names to provide custom user interface to the view.<br />
3. The view is then embedded in a page or a form that contains the DHTML code. Mark<br />
the text as pass through HTML by highlighting it and selecting Text - Pass-Thru<br />
HTML.<br />
114 of 217
4.5.3 XPage design and coding consideration<br />
The XPages are based on JSF and they honor the concept of the JSF object lifecycle.<br />
Here are some of the rules that you should follow to obtain the maximum out of your<br />
application.<br />
Upgrade<br />
Upgrade your environment to the latest available version.<br />
Custom controls<br />
You should use custom controls wherever possible in your application for effective<br />
reusability of the code. Refer to 4.6 Optimizing XPages using custom control for more<br />
details.<br />
Themes<br />
In order to have a hassle free and simplistic user interface control, you should use<br />
themes which gives you a centralized control of all the user interface classes. Refer to<br />
5.1 Themes for more details.<br />
GET-based requests<br />
Use GET-based requests wherever possible instead of POST-based requests. This<br />
saves valuable server processing time and also allows you to skip phase two to five of<br />
the lifecycle.<br />
Partial execution mode<br />
Use "Partial Execution" mode if only a portion of the page should be updated and<br />
processed. You can use "execMode" property of the event handler. If you combine this<br />
with "execId" then you can specify a particular target on the page. This allows phases 2,<br />
3, 4, and 5 to be processed on the submitting control, and any children referenced by the<br />
event handler.<br />
115 of 217
Readonly property<br />
When there is no processing required by any controls within a container, use the<br />
"readonly" property on container type controls (For example, on a panel containing a list<br />
of computed field controls, nothing is editable; therefore, no server-side event handlers<br />
need to be executed).<br />
Partial refresh<br />
Use "Partial Refresh" whenever possible. It improves the performance of an application<br />
by reducing the amount of HTML markup that must be processed which in turn leads to<br />
saving in the server utilization time. This will improve performance of phase 6 of the<br />
lifecycle.<br />
Immediate property<br />
You can eliminate lifecycle phases 3, 4, and 5 using the "immediate" property.<br />
Occasionally, you only need to identify the triggered event handler and then redirect to<br />
another XPage without any further server-side processing against the underlying data<br />
model. In this case, you do not need the Process Validations, Update Model Values, and<br />
Invoke Application phases to be executed. One example of this type of interaction is a<br />
Cancel button that should navigate back to the previous XPage, or some other XPage.<br />
Use this option when your event handler needs to perform an action and then redirect to<br />
a different XPage.<br />
Data Caching<br />
When a xp:dominoView data source is included on an XPage, the server has to save the<br />
values displayed by the page in case of a POST-back request. This ensures that the<br />
same data is available to all the requests in the lifecycle regardless of the changes made<br />
in the underlying view. However, this has its side-effects:<br />
116 of 217
Data saved for the page consumes a large amount of memory which overloads the<br />
JVM on the server.<br />
Extra processing as some objects cannot be kept in memory between requests.<br />
To avoid this you can use ‘dataCache’ property to optimize the view. There are three<br />
values supported:<br />
<br />
<br />
<br />
Full [default]: The entire view data is persisted after a request. Consumes most<br />
memory and CPU utilization.<br />
ID: Only a minimum amount of scalar type view related data, such as ID and position,<br />
is persisted after a request. Consumes least amount of CPU utilization and optimized<br />
amount of memory utilization.<br />
None: No view related data is persisted after a request. Consumes least amount of<br />
memory utilization and most amount of CPU utilization.<br />
Value bindings<br />
In your XPage's value bindings, you can utilize one of two different binding types to<br />
control when the expression is evaluated. These binding types are:<br />
<br />
<br />
#{ }: Compute dynamically<br />
${ }: Compute on page load<br />
The first, #{ } (hash-brace), tells the XPage to evaluate the binding on page load and<br />
every subsequent refresh. The second type, ${ } (dollar-brace), tells the runtime<br />
environment to only evaluate the value at page load and use the same value for the life of<br />
the page. You should be using the dollar-brace if your value will not change throughout<br />
the life of your XPage.<br />
Scope variables<br />
You should use the viewScope object to maintain server-side buffering objects and<br />
variables for an XPage instead of the other scopes, such as sessionScope and<br />
applicationScope which use more memory. However, you should also look at the usage<br />
of the referred object to decide its scope.<br />
viewScope: Exists for the life a view (rendering of a page)<br />
requestScope : Exists for the life of a request ( can span pages)<br />
sessionScope : Exists for the life of user session<br />
applicationScope: Exists for the first loading of the application until a timeout (default<br />
is 30 minutes)<br />
Use Java<br />
Minimize the use of SSJS (server-side JavaScript). Every time any SSJS expression is<br />
evaluated, <strong>Domino</strong> parses the expression in realtime into an abstract syntax tree, then<br />
runs Java code that is a rough approximation of how the JavaScript specification states<br />
that code matching the detected syntax should run. The more you move your logic<br />
directly into true Java classes, the faster it runs.<br />
Memory utilization<br />
The notes.ini parameter of "HTTPJVMMaxHeapSize" on the server gives you control<br />
over the amount of memory allocated to the JVM. You should work with your<br />
administrator to have it set to 512M or 1024M to serve more concurrent users depending<br />
on the availability of resources on your server. In case of 32-bit systems especially<br />
117 of 217
Windows you should know that there is only a limited amount of memory available to you.<br />
Server page persistence<br />
The JSF framework of XPages utilizes persistence for a predefined maximum number of<br />
component tree state representations for XPages requested by a user during their<br />
session. This process happens in order to allow a component tree to be restored with its<br />
previous state as a user navigates through an application. It also helps to improve the<br />
performance of the phase 1 of the JSF lifecycle when reconstructing a component tree.<br />
This feature is known as Server Page Persistence and you can configure it using the<br />
XPages tab of the Application Properties.<br />
Preloading<br />
In 8.5.3 new notes.ini parameters have been introduces which allows you to preload<br />
underlying XPages Java classes before the application is opened. They work both on<br />
client and server so the user has the same experience on both platforms.<br />
<br />
<br />
XPagesPreload=1<br />
XPagesPreloadDB=db.nsf/myPage.xsp,other.nsf/myPage.xsp (for specific<br />
applicaitons)<br />
4.6. Optimizing XPages using custom control<br />
If you are a <strong>Domino</strong> developer, you are already familiar with the practice of using<br />
common design element subform in a form. If you have been a Java developer, you must<br />
have used extensions of other classes in your code.<br />
Custom Controls are a similar new design element that was introduced along with<br />
XPages in the <strong>Domino</strong> Designer. In short, Custom Controls act as reusable<br />
subcomponents of XPages.<br />
Some of the characteristics that define Custom Controls are:<br />
<br />
<br />
<br />
<br />
<br />
<br />
They are componentized parts of your application.<br />
They are much advanced version of subforms.<br />
You can use them multiple times on a single page.<br />
You can define parameters for custom controls.<br />
They can be shared across applications.<br />
They can be nested.<br />
There can be different approaches for using Custom Controls in your application. The<br />
first and the most typical approach is to use them for coding parts of application that<br />
contain some logic and are used multiple times across the application. The second<br />
118 of 217
approach is to use them for breaking down the application user interface in parts so they<br />
can be used and changed easily across multiple pages. For example, when you are<br />
using the OneUI theme, you break down the components under different custom controls<br />
for heard, footer, left column, content, and so on .<br />
The use of Custom Controls with XPages, can simplifies your development effort to a<br />
great extent, the sooner you start using them the better it will be. Custom Controls allow<br />
you to break up your application in small manageable parts which can be reused as part<br />
of the bigger picture. This approach is particularly beneficial if there are multiple team<br />
members working on the same application. You are also able to take advantage of other<br />
sources internal or external if you use this approach and this in turn help you gain in<br />
productivity and efficiency.<br />
4.7. Naming standards<br />
The purpose of naming standards is mainly to enforce consistency and its immunity to<br />
remain compatible with the environment. Naming standards should be decided for each<br />
and every resource in the application including the database name, form, view, agent,<br />
and other design elements.<br />
In additional to the name, make use of alias names wherever possible. This allows you<br />
to change or translate the name without breaking the reference to the original name in<br />
the application design.<br />
If your development team already uses a more elaborate naming standard where aliases<br />
for different design elements have different prefixes, you can stay with that naming<br />
standard. The important thing is to have a consistent standard and to apply it from the<br />
very start of the development cycle.<br />
The following are the general guidelines about naming:<br />
<br />
<br />
Do’s<br />
o<br />
o<br />
o<br />
o<br />
o<br />
Don’t’s<br />
o<br />
o<br />
o<br />
Consistent naming conventions across design module.<br />
Name should identify an item or its purpose.<br />
Use of prefix to group the like items.<br />
Use of cascading names to provide a hierarchy representation to group<br />
elements (that is, use “\” backslash).<br />
User interface elements should be descriptive and accelerator key<br />
character should be identified.<br />
Long names should be avoided.<br />
Special characters usage to be avoided, for example, “$”, “#”, and “@”.<br />
Special keywords should be avoided.<br />
119 of 217
4.8. Internationalization<br />
Every application should be designed with international users in mind. Though your target<br />
audience might be entirely in one country initially, the situation might change in the future.<br />
Some applications grow over time, and some application designs are recycled into new<br />
applications that might have different target audiences. This section describes some code<br />
techniques for dealing with international applications.<br />
This article is not meant to be an all-encompassing detail of how to internationalize an<br />
application. There are many resources available on the Internet to assist with further<br />
details of the items discussed below.<br />
4.8.1 Dates and times<br />
When displaying dates, be aware that not everyone views a date value the same. For<br />
example, 10/11/12 could mean the 10th of November or the 11th of October. It is best to<br />
show dates with a month name (either abbreviated of spelled out). It is also best to<br />
always use a four-digit year, to decrease confusion.<br />
To format a date in the current user's locale, there are built-in Java classes to do this. As<br />
an example, this code shows the current date (“now”) and current time in the user's<br />
defined LONG date format:<br />
java.text.DateFormat.getDateInstance(java.text.DateFormat.LONG,<br />
context.getLocale()).format(now)<br />
java.text.DateFormat.getTimeInstance(java.text.DateFormat.LONG,<br />
context.getLocale()).format(now)<br />
If designing a Notes client application, take advantage of the client's capability to format<br />
dates according to the user's local preferences. This mainly means that you should avoid<br />
converting date/times to string values that you then store in the database. Dates and<br />
times should be stored using the built-in date-time item type, and only converted by the<br />
user's client.<br />
As an example of what not to do, consider the following field formula for a computed field:<br />
"Updated by " + @V3UserName + " on " + @Text(@Today)<br />
If a document is edited by a user in France, let's say, then the field is assigned a value<br />
such as "Updated by Michelle Dubois on 7/4/2012", meaning April 7th. But users in some<br />
other places -- the USA, for instance -- are used to seeing the month first, so they are<br />
likely to misinterpret this as July 4th. What's worse, because the value in each document<br />
reflects the settings of the user who last edited it, the documents are not even consistent<br />
in how they format dates; in some, "7/4" means April 7th, in others it means July 4th.<br />
To avoid such difficulties, your application should store this information in two fields -- a<br />
Text field for the name of the editing user, and a date/time field for the date. Since the<br />
client calculates how to display the date when the user opens the document, the user's<br />
preferred settings will always be used. Even if you override the default formatting to<br />
specify that dates will always be displayed in U.S. format, at least then your formatting<br />
will be consistent.<br />
120 of 217
A similar situation occurs in view column formulas, when @Text is used to convert<br />
date/times. Because the view index is calculated by the server, the conversion takes<br />
place according to the server's settings rather than those of the end user. It is generally<br />
better, if your column is to display a date or time value, to have a view column formula<br />
that returns a date/time value, not text. You can use the column settings to control<br />
formatting if you wish, but it's usually better to let the users see dates in the format that<br />
they have established as their personal preference.<br />
NOTE: While you would want to avoid using @Text to convert a date in a computed field<br />
or computed when composed, it's fine to do this in a computed for display field, since the<br />
value in that case is not stored, but only used locally.<br />
NOTE: in the above example, it's also a bad idea to make the text "Updated by" and "on"<br />
part of the field value, since that will cause problems if you make the application<br />
multilingual later, and because it's a waste of space to store these characters in every<br />
document.<br />
4.8.2 Time zones<br />
When displaying time values, you should make it clear what time zone they are in. Either<br />
display the zone, or if you convert all times to the local time zone, indicate this somehow<br />
(e.g. by the text "(local time)" after the value. A time of 8:00 AM means quite different<br />
things if it is 8:00 AM Greenwich Mean Time or 8:00 AM Hawaiian Standard Time. The<br />
Edit Box controls in XPages and the Date/Time fields in forms and views can easily show<br />
the time zone along with the time value. There is a TimeZone field type which can be<br />
used to select a time zone in traditional Notes development. A TimeZone field converts to<br />
a combo box with all the available time zones on the web.<br />
In XPages development, there is an application property which says if the time zone<br />
should use the server default (choice comes from a properties file), the user's time zone,<br />
or the server's time zone. There is also a TimeZone object in Java that can be used. For<br />
more information about using time zones in your XPages development, refer to the wiki<br />
article Time Zones in XPages<br />
Another zone issue can result from using the <strong>Lotus</strong>Script date/time variant datatype to<br />
assign date-only values to document fields. For details, and general recommendations<br />
and troubleshooting for working with date/time values, consult the Designer wiki<br />
document, Working with Date/Time Values in <strong>Lotus</strong> Notes.<br />
If you need a particular component of a date -- if you want just the year, for instance -- do<br />
not convert the date to text, then use string functions (Mid$, @Explode, etcetera) to find<br />
the year, month or day. Your code will break when used by someone with different<br />
preferences than yours -- which can occur even if the user is in the same city.<br />
4.8.3 Currency<br />
When developing international applications, you cannot make assumptions about number<br />
and currency formats. For example, the thousands separator in Europe is a period and<br />
the separator between whole amounts and fractional amounts is a comma. But in the<br />
United States, the comma is the thousands separator and a period separates the whole<br />
121 of 217
amount and the fractional amount. There are many JavaScript examples on the web that<br />
will format a number in the United States format. The following best practice can be used<br />
to display a currency value in the end user's format:<br />
<br />
<br />
<br />
Determine if the user has a decimal or comma as the separator between the whole<br />
amount and the fractional amount<br />
Use the “other” character as the thousands separator<br />
Format the number appropriately<br />
To determine the separator character between the whole amount and the fractional<br />
amount, use the following server-side JavaScript code:<br />
var decimalSep = Number("1.5").toLocaleString().substr(1,1);<br />
Concerns of the decimal and thousands delimiter being different with different users also<br />
apply when developing Notes client applications. As explained above regarding date/time<br />
values, when working with numbers, it's better to store the number in an item of type<br />
Number, not as text. Avoid using @Text in computed field formulas and view column<br />
formulas.<br />
If displaying a value with a currency symbol, bear in mind that the local currency symbol<br />
is an OS preference also. If your value is in US dollars (let's say), make sure you specify<br />
$ as your currency symbol in the formatting settings of Notes fields and view columns.<br />
Otherwise, users in other countries will see their local currency symbol beside the<br />
number.<br />
There is not an value type in <strong>Lotus</strong> Notes that includes an amount and a currency<br />
selection; you would have to store this information in two separate fields.<br />
122 of 217
4.8.4 Native language<br />
When possible, application output should be available in a variety of languages. This<br />
broadens the audience for your application and decreases confusion for uses who do not<br />
speak your language fluently. The wiki "XPages: How to use the localization options"<br />
describes how to use multiple languages for your XPage applications.<br />
For Notes client applications, <strong>Domino</strong> Global Workbench (DGW) provides a way to convert<br />
a single-language application into multiple languages. It extracts strings and creates<br />
properties files which you can hand over to translators; then you use DGW again to<br />
import the files to create different national-language versions of each design element in<br />
your application. So for instance, your one NSF would contain a form in English, and the<br />
same form in French, and so on. Notes client users will be presented the version of the<br />
form, view or whatever that corresponds to their language preference.<br />
NOTE: Views have performance impact, as described elsewhere in this guide. Do not<br />
use the "Automatic" indexing option for views in multilingual applications, since that will<br />
cause all language versions of the view to be indexed on all servers, even if nobody on<br />
the server uses that language. "Auto on first use" is a better choice. You might also want<br />
to discard indexes after a shorter number of days than you otherwise might.<br />
4.8.5 The I18n class in XPages<br />
You can use the I18n class to perform many types of conversions and result in correct<br />
displays of information based on the locale of the reader. The following example displays<br />
a date and time in your desired format:<br />
I18n.toString(JavaDate, pattern)<br />
There are many date patterns available.<br />
The I18n class can also be used to convert a time from one time zone to another time<br />
zone. For example, you can display the time in both Greenwich Mean Time and the<br />
user's current time zone.<br />
4.9. Scoped variables<br />
If you are a <strong>Domino</strong> developer, you are already familiar with the practice of using<br />
common design element subform in a form. If you have been a Java developer, you must<br />
have used extensions of other classes in your code.<br />
Custom Controls are a similar new design element that was introduced along with<br />
XPages in the <strong>Domino</strong> Designer. In short, Custom Controls act as reusable<br />
subcomponents of XPages.<br />
Some of the characteristics that define Custom Controls are:<br />
They are componentized parts of your application.<br />
They are much advanced version of subforms.<br />
You can use them multiple times on a single page.<br />
You can define parameters for custom controls.<br />
They can be shared across applications.<br />
They can be nested.<br />
123 of 217
There can be different approaches for using Custom Controls in your application. The<br />
first and the most typical approach is to use them for coding parts of application that<br />
contain some logic and are used multiple times across the application. The second<br />
approach is to use them for breaking down the application user interface in parts so they<br />
can be used and changed easily across multiple pages. For example, when you are<br />
using the OneUI theme, you break down the components under different custom controls<br />
for heard, footer, left column, content, and so on .<br />
The use of Custom Controls with XPages, can simplifies your development effort to a<br />
great extent, the sooner you start using them the better it will be. Custom Controls allow<br />
you to break up your application in small manageable parts which can be reused as part<br />
of the bigger picture. This approach is particularly beneficial if there are multiple team<br />
members working on the same application. You are also able to take advantage of other<br />
sources internal or external if you use this approach and this in turn help you gain in<br />
productivity and efficiency.<br />
124 of 217
Chapter 5. User interface considerations<br />
When designing an application you must remember that people will be interacting with it<br />
through the front end you design. If you make it hard for the users to understand what<br />
they are to do or make it confusing, then they will try at all costs to not use it. Internal<br />
application suffer the most since it is to a captive audience. Make the user interface clean<br />
and intuitive for the users (not necessarily for the developers). Pick only a couple of font<br />
families, the fewer the better. Target the age of your audience when picking font size.<br />
XPage applications are web application that can also be utilized in the Notes Client.<br />
There is much information regarding the proper design of a web application and this<br />
chapter deals with the aspects that pertain to XPages.<br />
Make sure your design:<br />
<br />
<br />
<br />
<br />
Is intuitive and easy to understand.<br />
Is Easy to use.<br />
Provides benefits to the user.<br />
Is readable: no small type or hard to read colors.<br />
The benefits of a good user interface include<br />
<br />
<br />
<br />
<br />
<br />
<br />
Increase employee productivity.<br />
Decrease employee error.<br />
Increase employee buy-in and participation in the application.<br />
Reduce training costs.<br />
Decrease technical support.<br />
Increase money saved.<br />
When designing user interface, the bottom line is that it is all about the user. Make the<br />
experience positive for them and successful for your company.<br />
5.1. Themes<br />
Themes were added with XPage to provide the developers with the ability to define the<br />
look and feel of an application. The themes provide the following abilities:<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Extensible.<br />
Add CSS resources to an XPage.<br />
Add JavaScript resources to an XPage.<br />
Link to specific controls using its theme ID.<br />
Apply property values to controls.<br />
Easy to select a different theme to give a different look and feel.<br />
Can be set globally (all applications) or per application.<br />
Different themes can be applied depending on the context.<br />
The theme is handled on the server side where it drives the page creation and controls<br />
the HTML generation. It is fully used by XPages, partially by the "classic" web engine.<br />
125 of 217
The hardest part will be recognizing how many things you can control from a theme if the<br />
results are to be used across multiple applications then put it in the theme.<br />
For the best practice, using themes make your application easier to change, and, make it<br />
easier to develop and maintain consistent elements that themes are applied to.<br />
5.1.1 Themes are extensible<br />
Themes can inherit from other themes and override elements of the inherited themes.<br />
You normally create a theme by extending one of the standard themes. <strong>Domino</strong> comes<br />
with three themes:<br />
<br />
<br />
<br />
Webstandard: The basic clean theme<br />
OneUIv2 ( oneuiv2, oneuiv2_red, oneuiv2_green, oneuiv2_metal, oneuiv2_gold)<br />
Notes: Notes client theme<br />
The default is the Webstandard.<br />
5.1.2 CSS resources<br />
Creating multiple theme document allows you to build different sets of style sheets that<br />
can be selected when the application is deployed. The application can easily have the<br />
look and feel changed by selecting which theme to use. For example, you can have<br />
different color-based themes. You can choose between red, blue, gold, or metal color<br />
themes with OneUI CSS framework.<br />
There are two options for applying CSS style sheets to an XPage applications:<br />
<br />
<br />
Add the CSS style sheet as a resource and select the styles in the XPage or custom<br />
control.<br />
Create a theme document and reference the CSS style sheet from it.<br />
Adding the style sheet directly to the XPage or custom control does have a few<br />
advantages:<br />
<br />
<br />
The list of classes will show in the Styles section for all the controls on the page.<br />
The design perspective for the XPage will try and apply the styles so visually you will<br />
see how the page will look without having to preview it.<br />
Note: You can add the style sheet to a custom control so it is applied to the rest of an<br />
XPage. However, make sure that you do not have it as a resource on multiple controls<br />
because it is loaded each time it is listed.<br />
Some of the advantages to using themes include:<br />
<br />
<br />
<br />
<br />
Building applications that are easily customized by a third-party.<br />
Tailoring the site to the user: You can compute the styling by requested device,<br />
language, or browser.<br />
Inherit from other themes such as the built in WebStandard or OneUI.<br />
Settings that are higher up the tree (themes you have extended from, styling set<br />
within the control) that can be overridden.<br />
126 of 217
Stylesheet and styling information can be computed<br />
rendered="#{javascript:context.isDirectionRTL()}"<br />
Component styling can be globally controlled; no need to set style information or<br />
class. All buttons across all applications have the same style with one place to control<br />
all the edits.<br />
The disadvantage is that the list of classes in the style sheets is not display in the Styles<br />
section for each control and the design perspective will not render the controls with the<br />
style sheets. This can fixed by using a dummy css files that only contains the style class<br />
names. For example:<br />
.lotusBtn {}<br />
.lotusBtn:focus {}<br />
.lotusBtn:hover {}<br />
.lotusBtnAction {}<br />
This allows the styles to show in the list and to be rendered in the Design pane. Do not<br />
forget to remove it before deploying so you save resources.<br />
5.1.3 Building theme<br />
To build a theme, the first thing is to select the theme you will be building upon by setting<br />
the inheritance in the Theme root element:<br />
<br />
If a theme extends a theme with the same name, then the new theme is searched at the<br />
upper level. For example, a database theme "oursite" can inherit from a global theme<br />
"oursite". All circular references are checked and prevented.<br />
Themes can control more than styling, there are other properties that can be set or<br />
overridden. Themes can be extended by using JavaScript, such as getting the type of<br />
browser and applying the style sheet needed. This allows for a style sheet to support<br />
older browsers or mobile devices and have the selection based on the type of device.<br />
This can be done by adding a "rendered" attribute to the resource tag. The following is an<br />
example:<br />
<br />
The rendered attribute is running server side JavaScript to determine which browser is<br />
being used in this example. If it is Internet Explorer (IE) versions 0 thru 6, the resource is<br />
rendered to the web browser. The resource does not get sent to the user’s web browser if<br />
you are using higher version of Internet Explore or a different web browser. This is a<br />
great way of adding special style sheets that contain hacks for some of the behaviors of<br />
styles in earlier versions of IE.<br />
Check for Safari If you want to include HTML5 and support the webkit based browsers:<br />
rendered="#{javascript:context.userAgent().isSafari()==true}"<br />
127 of 217
Style classes can be set depending on the scoped variables, as in the example below:<br />
<br />
Link.collapse<br />
<br />
styleClass<br />
#{javascript:(sessionScope.ec == null ||<br />
sesionScope.ec == 0) “xspDisableCollapse”: “xspEnabledColapse”}<br />
<br />
<br />
<br />
The example above applies a style to expand or collapse an area based on the value of the<br />
sessionScoped variable ec.<br />
You can have elements be hidden in one theme and available in another. Here is an example<br />
where additional information is display if a certain theme is selected.<br />
Create a new theme called oneuiv2-debug that extends the oneuiv2_red theme.<br />
<br />
<br />
<br />
debugInfo<br />
<br />
styleClass<br />
debugInfoVisible<br />
<br />
<br />
:<br />
The tags contain the themeID and the contains the properties to be set. So the property<br />
styleClass is set to debugInfoVisible which is a CSS class. The CSS class:<br />
.debugInfoVisible {<br />
background-color: #EEFEE1;<br />
border-color: #CCEBB5;<br />
border: 1px solid;<br />
padding: 10px;<br />
}<br />
128 of 217
On one of the custom controls is a div tag that contains the debugging information:<br />
<br />
<br />
Debug info<br />
<br />
Debug info is displayed when a debug-mode theme has<br />
been selected in the Application Properties<br />
<br />
<br />
<br />
<br />
<br />
<br />
Author:<br />
<br />
<br />
<br />
<br />
<br />
Session Scope:<br />
<br />
<br />
<br />
The div only shows if the debugTheme is selected.<br />
You can set the control or property to over ride the base theme setting or to just extend<br />
them.<br />
The control override value can be true (your property only is used) or false (your property<br />
is added to any in the theme):<br />
<br />
debugInfo<br />
<br />
styleClass<br />
debugInfoVisible<br />
<br />
<br />
The property can have the mode value be "override" (your property only is used) or<br />
"concat" (your property is added to any in the theme):<br />
<br />
debugInfo<br />
<br />
styleClass<br />
debugInfoVisible<br />
<br />
<br />
129 of 217
5.1.4 Themes and classic <strong>Domino</strong><br />
The theme property only works on classic web elements if the Enable enhanced HTML<br />
generationoption is selected on the database properties dialog box.<br />
To include the same style sheet on all the forms in your database, you can use a theme.<br />
First check the Enable enhanced HTML option. Then create a theme design element<br />
with the following content in it:<br />
<br />
text/css<br />
mystylesheet.css<br />
<br />
That automatically adds the stylesheet to the form. You can set the style applied to the<br />
<strong>Domino</strong> controls by putting the following in the theme:<br />
<br />
body<br />
<br />
style<br />
bodyframe<br />
<br />
<br />
This automatically puts a style tag with the specified value on every body tag generated.<br />
5.2. CSS: Framework and location<br />
5.2.1 CSS – frameworks<br />
A CSS Framework is a collection of pre-built cascading style sheets (CSS) designed for a<br />
specific layout and styling of web applications. These frameworks are usually well<br />
documented, configurable, and tested for popular browsers. CSS frameworks are<br />
increasingly used as a best practice for developing web applications as the benefits of<br />
using them outweigh the drawbacks.<br />
A CSS Framework provides these advantages:<br />
<br />
<br />
<br />
Reduced development time: Developers are able to focus on the core functionality of<br />
the application versus the look and feel by using pre-built CSS classes for layout and<br />
styling.<br />
Improved user experience and reduced training needs: Due to the consistent look<br />
and feel across various web applications.<br />
Accommodate various browser versions and screen resolutions: You can see what<br />
browsers are support so you do not have to try to build a CSS that covers all the<br />
quirks.<br />
130 of 217
Documentation: Very few in house frameworks have documentation.<br />
Some of the drawbacks of using a CSS framework include:<br />
<br />
<br />
A learning curve to understand a framework and its configuration options.<br />
Potentially being locked into a specific layout and navigation structure.<br />
Some of the popular CSS Frameworks are listed below:<br />
<br />
<br />
<br />
<br />
<br />
<br />
OneUI (from <strong>IBM</strong>)<br />
Blueprint (for information on using Blueprint with XPages, see David Leedy's Notes<br />
in 9 videos at notesin9.com)<br />
Elements<br />
Grid960<br />
YUI 2 (from Yahoo)<br />
iUi (for mobile applications)<br />
When picking a framework, make sure it supports using classes and not IDs. XPage<br />
control IDs are dynamic and created when it is rendered, so you can not be sure you<br />
have the correct ID.<br />
Instead of using:<br />
Y<br />
<br />
You would use :<br />
.<br />
Select your framework before starting to code. It is not that easy to change the layout<br />
after the application is built.<br />
5.2.2 Using OneUI V2<br />
All the resources for the OneUI framework (style sheets and images) are already<br />
accessible because it is delivered as part of the <strong>Domino</strong> server, Notes client, and <strong>Domino</strong><br />
Designer. You do not have to import them separately for each application. Classes for<br />
Dojo are also included. This makes it easier to use this framework within <strong>Domino</strong><br />
applications.<br />
Different HTML tags that are used for web development are referred to during the lesson.<br />
All the HTML tags and attributes are supported by XPage and can easily be embedded in<br />
the code as-is. Most HTML are entered through the source view where you see the<br />
actual XML source for the XPage.<br />
For more information, see the OneUI Developer document at http://www-<br />
12.lotus.com/ldd/doc/oneuidoc/docpublic/components/framework.htm.<br />
Using the OneUI classes<br />
The OneUI provides class to render the basic layout of the page. There are classes to<br />
131 of 217
style the banner, navigation, footer content, and more.<br />
The following figure shows the One UI breakout:<br />
Frame<br />
The frameis the main container for the rendered web page. This is where the background<br />
color and the width of the site are set.<br />
Banner<br />
The banner sits at the very top of the UI and contains application links, utility links (help,<br />
log in), and the application logo. It picks up the background of the page. It is plain white in<br />
the figure above.<br />
Title bar<br />
The title bar contains application, or sectional, navigational tabs. It also can contain a<br />
search component.<br />
Place bar<br />
The place bar sits under the title bar, to show you what "place" you are in. It usually<br />
indicates an area that you can join, such as an activity or community. The bottom border<br />
of the title bar serves as the top border of the place bar.<br />
Main<br />
Main is the body of the page. It contains the left column, content, and right column.<br />
Left column – Local navigation<br />
The left column is usually the navigation within a section of the application. For example,<br />
a time entry application would have a section that may take you to projects, time reports,<br />
and so on. In the Time report section, the application navigation would be to show<br />
submitted time reports, all months, and unsubmitted time reports.<br />
Content<br />
The content area is where the forms and views are displayed.<br />
132 of 217
Right Column – Sidebar<br />
The right column – sidebar provides additional sections that can be viewed by the user.<br />
This is similar to the left column and can be used for navigation based on how you want<br />
to layout your page.<br />
Footer<br />
The footer sits at the bottom of the page and contains links to Help and other features.<br />
The basic HTML layout of the page is:<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
In general, when linking CSS into your page, the following order must be used:<br />
1. Base Styles: required<br />
2. Component Styles: required<br />
3. Layout Styles: optional<br />
4. Base Theme Styles: required<br />
5. Component Theme Styles: required<br />
6. Layout Theme Styles: optional<br />
7. Dojo Styles (dijit.css): optional<br />
Note: this file is from dojo's dijit and theme directory.<br />
8. Dojo Override Styles: optional<br />
9. Dojo Override Theme Styles: optional<br />
10. Product-Specific Styles<br />
For the OneUI, the CSS file order is:<br />
1. core.css<br />
2. defaultTheme.css<br />
3. Dojo File: dijit.css (optional)<br />
4. dojo.css (optional)<br />
5. dojoTheme.css (optional)<br />
6. your custom css<br />
When working with any framework, break up your model page structure into custom<br />
controls.<br />
One of the best ways to build your application is to create a custom control for each<br />
section of the framework. This way you can easily find the section to change and also<br />
can:<br />
133 of 217
Modularizes page structure.<br />
Provides more flexibility going forward.<br />
You will probably want to in the future anyway so easier to do it now.<br />
The follow shows an example of the custom controls for the OneUI:<br />
Do not forget to come up with a naming standard to help make your life easier. Here we<br />
use layout_sectionname for page section and ccControlname for content sections.<br />
The mainframe control contains all the other layout controls, so it is what is placed on the<br />
XPage.<br />
The panel named mainframe has the lotusMain style applied to it. All a developer has to do now is<br />
to create an XPage, drag the mainframe custom control on to it, and the custom control that<br />
contains the content they want.<br />
134 of 217
5.2.3 CSS location<br />
The CSS files you create can be placed either in the NSF or in the /data/domino/html<br />
folder on the server.<br />
In folder:<br />
<br />
<br />
<br />
<br />
<br />
Available to all web application on the <strong>Domino</strong> server<br />
Not visible in design pane. Use dummy CSS to get around this.<br />
Can be automatically GZIP compacted - ( server configuration).<br />
Can use dummy CSS to include in the NSF - ease of updates, see in design pane.<br />
Downloaded only once to the browsers.<br />
In the NSF:<br />
<br />
<br />
<br />
<br />
Available only to current application.<br />
Visible in design pane.<br />
Easy to access and edit.<br />
Downloaded to the browser for each application it is used in,<br />
Note: Take care to include only once on XPage (if on each control, it will be downloaded<br />
each time)<br />
The CSS Frameworks used across application should be stored on <strong>Domino</strong> and a CSS<br />
that has changes and additions is stored in the NSF. This lets you make minor changes<br />
needed for the specific application when needed.<br />
5.3. XPages versus forms<br />
As application designers, you are challenged with finding ways to provide the application<br />
with rich, functional user interface components to accommodate the creation,<br />
modification, and presentation of data for <strong>Lotus</strong> Notes clients, web clients, and, mobile<br />
devices. This section reviews the form, a traditional design element for <strong>Domino</strong><br />
applications, followed by the newest member of the <strong>Domino</strong> design elements: XPages.<br />
We discuss both and provide best practices in <strong>Domino</strong> application design along the way.<br />
5.3.1 <strong>Domino</strong> form<br />
In traditional <strong>Domino</strong> application development, a form is used for a variety of purposes,<br />
many of which we briefly review in this section.<br />
Metadata container<br />
On a form, you can define fields which are used to hold a variety of data to be stored<br />
within the <strong>Domino</strong> application. The following figure shows a form example from the<br />
<strong>Domino</strong> 8.5.x Discussion Database:<br />
135 of 217
The form contains fields, which house the metadata entered by the user, computed by<br />
<strong>Domino</strong>, or computed based on the results of an external process (depending on the<br />
design of the application).<br />
User interface<br />
Another important task that you must accomplish is to make the form functional and easy<br />
to use for the user. This is the basis of user interface design, as shown in a newly<br />
created document using the above form:<br />
Notice that the metadata (Subject, Category, and Content fields) are bound to the form<br />
and its actions (Save and Close, Mark Private, or Cancel.), creating a tightly-coupled<br />
relationship between the form and document metadata.<br />
136 of 217
Business logic container<br />
Also tightly coupled to the form and metadata is the business logic (custom<br />
programming). Business logic can include custom workflow processing, integration with<br />
external systems, and other computational functionality as needed. Since this is defined<br />
within the form (which contains the fields), there is an even greater tightly-coupled<br />
relationship between the document metadata, the form, and the business logic used to<br />
process it.<br />
One of the biggest challenges of traditional <strong>Domino</strong> application design is to create a<br />
useable, functional interface for the Notes Client and web browsers. Traditionally, it is<br />
common to create two forms – one for use in the Notes Client and the other for use<br />
through web clients, each containing their own user interface components and associated<br />
business logic for the respective client. While this provides the desired results, we often<br />
find application maintenance a challenge, for you must implement each new feature<br />
twice.<br />
5.3.2 XPages<br />
Introduced in <strong>Lotus</strong> Notes and <strong>Domino</strong> version 8.5.1, XPages offers a whole new way to<br />
design, develop, and maintain <strong>Domino</strong> applications for various clients (<strong>Lotus</strong> Notes, web<br />
browsers, and mobile devices). In effect, XPages gives a "write once, run anywhere"<br />
approach to application design. Here we explore some best practices for using XPages,<br />
including the integration with forms, server-side verses client-side processing, and<br />
rendering hide-when scenarios that, if implemented properly, will produce fast, efficient<br />
applications that are easy to maintain across various clients.<br />
An XPage is a design element (similar to forms and views) that you can design to<br />
perform the same functions that traditional <strong>Domino</strong> design elements, for example,<br />
Pages, Forms, Views, Embedded Views, Navigators, Outlines, and more. As an<br />
example, the “myDocuments” XPage from the <strong>Domino</strong> 8.5.3 Discussion Template is<br />
shown below:<br />
137 of 217
There are many different types of information that are present to the end user, all of<br />
which are contained in a single XPage. These items originate from the Controls List<br />
(along the right side of the screen), and are implemented in a drag-and-drop fashion. For<br />
each control, you can populate various code segments and properties to give the look,<br />
feel, and functionality that you desire.<br />
While this might not seem like such an accomplishment, consider displaying the<br />
Discussion application using the traditional <strong>Domino</strong> view elements, as shown in the<br />
following two figures.<br />
This figure shows a traditional view displayed in the Notes Client.<br />
This is a traditional view displayed in a web browser.<br />
138 of 217
With respect to the above user interface displays, it is important to note the following:<br />
<br />
<br />
Dissimilar user interface: Note that, even though there is only one application, we<br />
must contend with two user interfaces – one for the Notes Client, and one for the web<br />
browser. This can increase user frustration which can impact application usability.<br />
Navigation elements: When two user interfaces are required, the developers have<br />
to define each piece of functionality twice – once for the web browser, and again for<br />
the Notes Client. Depending on the navigation element desired, this can greatly<br />
increase application development and maintenance time.<br />
Other traditional <strong>Domino</strong> application design elements can provide the same level of<br />
dissimilarities in multiplatform development efforts.<br />
The following two figures are user interfaces for Notes clients and web clients. These<br />
user interfaces have the exact same information but are with a single XPage-based<br />
design element.<br />
This figure shows the XPages displaying a view In the Notes Client:<br />
139 of 217
This figure shows the XPages displaying a view in a web browser:<br />
The benefits of using XPages in the development of the user interface of a application<br />
should be obvious – you can create a single application that has a uniform interface and<br />
functionality, across the Notes Client and web browser platforms.<br />
<strong>Best</strong> practice<br />
From a fundamental application development viewpoint, it is advisable to fully utilize the<br />
XPages UI paradigm in application development.<br />
5.3.3 XPages and forms<br />
You can use a form to define the user interface, the metadata and integrated business<br />
logic for <strong>Domino</strong> applications, typically using one form per platform. Whereas, using the<br />
new XPages design methodology, you limit the use of forms to defining the metadata for<br />
a document only and use XPage to build the functionality, business logic, and user<br />
interface once. These are usable across multiple platforms.<br />
As an example, consider the following Main Topic Form from the Discussion template for<br />
<strong>Lotus</strong> Notes 8.5.3:<br />
140 of 217
Here, the fields (the metadata), the actions (or business logic, along the right side of the<br />
diagram), and the user interface components (for example, the graphic in the<br />
background) are tightly bound to one form. Two forms are built, one for the Notes Client<br />
and one for the web browser.<br />
Using XPages, you can use forms just to define the metadata, as outlined below:<br />
1. Define a form which contains the fields only (the field name, data type, and computed<br />
and editable properties and respective computed formulas). In XPages terminology,<br />
this form is referred to as a data source.<br />
2. To design the actual user interface, define an XPage which uses the data source<br />
from step 1 . This makes the appropriate fields available to the user for data entry<br />
and manipulation.<br />
3. The result is a single design element (the XPage) that can be used to create, edit,<br />
and delete documents using a consistent user interface and a single set of business<br />
logic.<br />
To demonstrate, we use the <strong>Domino</strong> Discussion template for Notes 8.5.3. On this<br />
XPage, we find another XPages element, a Custom Control, as shown below:<br />
141 of 217
The Data source field on the top of the right pan , shows that this XPage Custom Control<br />
is linked to the data source (that is form) called dominoDoc, allowing you to create<br />
documents using this form through an XPage (think of the XPage as a "front end" to the<br />
form).<br />
In addition, you can place the metadata from the form on the XPage in a more "freelyflowing"<br />
format, giving you a user interface design that is flexible, functional, and<br />
modern. If we view the properties of the XPages Custom Control, you can see how this<br />
control and the data source are linked together:<br />
142 of 217
A brief explanation is given below:<br />
<br />
<br />
Default action: The value newDocument instructs XPages to effectively create a<br />
new document, by default, whenever this Custom Control is presented to the user.<br />
Run form validation: If you have input translation and input validation formulas on<br />
you form, “on document save” instructs XPages to process those formulas<br />
whenever the document is saved. Although the preferred method of validation is to<br />
place the validation code on the XPage itself, <strong>Domino</strong> gives you the flexibility (which<br />
is especially useful during application migrations from traditional to XPages design<br />
methodologies).<br />
5.3.4 XPages data validation and translation<br />
Validating the value in a field is a common programming technique and requirement.<br />
Assume your form required a a field called Subject that is a required field (in other words,<br />
you cannot save the document unless this field is populated). To accomplish this, you<br />
can write an input validation formula for the field, resembling the following:<br />
@If(Subject = “” ; @Failure(“Please provide a subject”) ; @Success)<br />
This approach has the following implications:<br />
<br />
<br />
<br />
From the Notes Client side, execution of this formula would be fast, for the formula is<br />
run on the Notes Client.<br />
From the web client side, because web browsers cannot execute @Functions, the<br />
execution of this formula would result in a round trip to the server for processing The<br />
browser would execute the validation formula, and, assuming that the Subject field is<br />
empty, return the result of the @Failure message.<br />
You could implement the input validation using Javascript, however, this would<br />
increase the complexity of the application.<br />
143 of 217
With XPages, you can implement the same validation technique as shown in the<br />
following figure:<br />
You simply highlight the Subject field, and, using the properties panel, to instruct the<br />
XPages that this field is required, and the message to display to the users if they do not<br />
enter data into the Subject field.<br />
The result of using XPage validation is as follows:<br />
<br />
<br />
The validation properties execute identically on the Notes Client, web browsers, and<br />
mobile devices.<br />
The validation occurs on the client-side, maximizing application performance.<br />
Note that the validation is not limited to the simple validation shown above. You can<br />
write full-scale business validation logic, instructing XPages to execute the code on the<br />
client side for maximum performance.<br />
5.3.5 Visible versus hiding<br />
With <strong>Domino</strong> application development, you have a number of tools which can change<br />
the user interface for the user at runtime – giving you power and flexibility over what the<br />
user “sees” and, how they ”see it.” This section review the techniques commonly used in<br />
traditional <strong>Domino</strong> applications (the hide-when) as well as the newer techniques brought<br />
by XPages (visibility and rendering).<br />
The hide-when options<br />
<strong>Domino</strong> application development provides a mechanism that let you decide what user<br />
interface components (fields, text, buttons, actions, graphics, and so on) that a user is<br />
presented with when they open an application. These options, called hide-when<br />
options, allow you to quickly and easily hide various components from a user based on a<br />
host of criteria, including:<br />
144 of 217
When a user opens a document for reading<br />
When a user opens a document for editing<br />
When a user prints a document (Notes client only)<br />
When a user previews a document (Notes client only)<br />
When a user copies a document to the clipboard (Notes client only)<br />
When a user views a design element that is embedded onto another design element<br />
(for example, a view embedded on a form)<br />
If these criteria are insufficient, you can also write a custom formula that must evaluate to<br />
true or false. In the event that the formula evaluates to true, the element will be hidden.<br />
If the formula evaluates to false, the element will be displayed.<br />
As an example, see the anatomy of a hide-when properties box in the Main Topic form of<br />
the <strong>Domino</strong> Discussion template from <strong>Lotus</strong> Notes 8.5.3:<br />
<strong>Domino</strong> automatically applies this formula based on "paragraph" boundaries, which<br />
include:<br />
<br />
<br />
Every item between the last time the user pressed the Enter key and the next<br />
occurrence of the Enter key<br />
The cell of a table<br />
Try this<br />
If you would like to fully understand the boundaries of the hide-when option, perform this<br />
experiment:<br />
<br />
<br />
<br />
<br />
In a test application, create a form named HWTest.<br />
On the form, press and hold the letter “A” key until you have multiple lines of the<br />
letter "A" on the form.<br />
Select one of the letters in the middle of the page, right-click to bring up the<br />
properties box, select the hide-when tab, and select the option "Hide When<br />
Editing".<br />
Preview the form<br />
145 of 217
When you preview this form in the Notes Client (or a web browser), all of the letter A’s<br />
are removed. Why Because the hide-when formula was applied to the entire<br />
paragraph since we did not press the Enter key, the formula was applied to all of the<br />
letter A’s back to the first occurrence of the letter A, and forward to the next occurrence of<br />
the letter A.<br />
The visible property<br />
XPages introduces a new property, the visible property, which allows you to choose<br />
whether you would like to view or hide an item at runtime.<br />
Consider the following example from our sample application:<br />
You have the navigation custom control selected for checking the Visible property. This<br />
instructs XPages to show the element on the client when you open this XPage. If you<br />
clear the checkbox, the element is sent to the browser, however, is hidden from us.<br />
Note the diamond icon to the right of Visible in the graphic above. This is an indicator<br />
that allows you to write a custom formula to programmatically control the visibility of an<br />
element. If there is code behind the diamond, then there is custom code behind the<br />
object. If the diamond is clear, then there is no custom code behind the object.<br />
Important note<br />
To fully utilize the visible property, you must understand the difference between the hidewhen<br />
and the visible property. In summary:<br />
<br />
<br />
The hide-when option instructs <strong>Domino</strong> to hide the element when the formula results<br />
to true.<br />
The visible property instructs <strong>Domino</strong> to show the element when the formula results<br />
to true, or the checkbox is checked, which automatically returns true.<br />
146 of 217
Rendering<br />
Rendering and visibility are often confused as being the same thing. While the end<br />
result is the same, there are some vast differences that you can encounter that can<br />
‘make or break’ an application, including processing, delivery, and subsequent dynamic<br />
updates to the user interface.<br />
Whereas visibility is generally done on the client, there are limitations that you will<br />
encounter when determining the visibility of an object, including:<br />
<br />
<br />
<br />
All information about the page is sent down to the client, regardless of whether it will<br />
be actually visible to the user. This can cause more data to traverse the wire than<br />
you actually need.<br />
Visibility is a fast way to dynamically update the user interface, for, since all data is in<br />
the browser, updates to the interface can occur quickly because processing occurs<br />
on the client.<br />
A limitation of the visible property is that all data required determining visibility must<br />
be pushed down to the client.<br />
A situation might occur where the determination of visibility may reside in the value of<br />
data sitting on the server. Since the data is not on the client, you e cannot use that value<br />
to determine visibility.<br />
Server-side rendering allows the <strong>Domino</strong> server to determine the visibility of an element,<br />
dynamically updating the user interface by passing data back and forth between the client<br />
and the server. The server, while processing an XPages component, can determine<br />
whether to send the actual component to the client.<br />
The use of server-side rendering has its considerations, including:<br />
<br />
<br />
All processing of the user interface is done at the server, thus, more server<br />
resources might be consumed.<br />
Since the server must make the determination of whether an element is visible before<br />
sending data down to the client, performance of the application can be impacted.<br />
As a best practice, it is always best to use client-side rendering when possible to assure<br />
that the application will scale and perform optimally.<br />
Sharing design elements using custom controls<br />
In traditional <strong>Domino</strong> application development, it is customary to design applications<br />
which promoted code re-use, componentizing the respective design elements for<br />
reusability. Some examples of traditional design elements which meet this endeavor<br />
include the subform, shared actions, shared fields, and more.<br />
This section reviews traditional <strong>Domino</strong> design elements promoting code re-use, and,<br />
how they apply to the new XPages development paradigm.<br />
Subform<br />
Assume that, as part of your application design, you require the same fields on various<br />
forms through your application in the same layout (that is. user interface), translation and<br />
validation formulas (among others). Traditionally, you could use the Subforms and Field<br />
to accomplish this goal by<br />
147 of 217
Placing each field on each form, independent from one another (or, use shared fields<br />
so that we only have to define the field one time).<br />
Placing the fields on a subform, then insert the subform into the main form as<br />
needed.<br />
Because the XPages do not support integration with subforms, the above approach is a<br />
challenge in the application design.<br />
<strong>Best</strong> practice<br />
When designing a new application, or, modernizing an application to use XPages,<br />
remember that direct subform integration, as well as other traditional <strong>Domino</strong> shared<br />
items, are not supported. For more information, see <strong>Domino</strong> Designer help for<br />
information related to traditional <strong>Domino</strong> design element integration with XPages.<br />
Custom controls<br />
A custom control is a reusable design element used in XPages that can contains various<br />
pieces of information, including, but not limited to:<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
User interface components<br />
Fields<br />
Views<br />
Business logic<br />
Static information<br />
Dynamic information<br />
Graphics<br />
Similar to subforms, you create a custom control in <strong>Domino</strong> Designer, and insert the<br />
control onto one or more XPages. Thus, modifying the custom control automatically<br />
update each of the XPages that use it (promoting code re-use).<br />
One example of how custom controls can help you build powerful applications is the<br />
integration of XPages applications with OneUI, a series of custom controls that permit<br />
148 of 217
you to develop consistent, reusable standard interface objects, navigation object, and<br />
more. For information about OneUI, see: http://www-<br />
12.lotus.com/ldd/doc/oneuidoc/docpublic/index.htm<br />
Creating a simple custom control<br />
Use these steos to create a new custom control in <strong>Domino</strong> Designer:<br />
1. Click New Custom Control, enter a new for this new custom control and select the<br />
application. See the figure below:<br />
2. After clicking OK, you are placed into the custom control editor in <strong>Domino</strong> Designer.<br />
Drag the button component from the controls list onto the new custom control, as<br />
shown below.<br />
149 of 217
3. The result is a single button whose properties you can modify to control the look, feel,<br />
and functionality of the button. In this example, we change the Label property to "My<br />
Custom Control", which results in the following:<br />
4. Save and close the custom control.<br />
To reuse the custom control, create a new XPage in <strong>Domino</strong> Designer, as shown:<br />
150 of 217
You can easily see all custom controls in <strong>Domino</strong> Designer by looking at the Custom<br />
Controls list in the lower right section of your screen. To use the custom control on the<br />
newly created XPage, you simply drag and drop it to the desired location, as shown:<br />
Upon preview in <strong>Lotus</strong> Notes, you see the following XPage with your newly created<br />
custom control.<br />
Note that the above XPage appears virtually identical in other client environments, such<br />
as web browsers.<br />
Assuming that you use your custom control in multiple XPages, if you change the custom<br />
control, you automatically propagate that change to all XPages that it is used on,<br />
promoting element and code reuse.<br />
151 of 217
You can now repeat the process of re-using the custom control on a variety of XPages,<br />
taking advantages of user interface design and code reuse in your <strong>Domino</strong> applications.<br />
5.3.6 <strong>Best</strong> practices<br />
<strong>Domino</strong> provides you with a host of application design features. When developing a<br />
<strong>Domino</strong> application, consider the following:<br />
<br />
<br />
<br />
<br />
<br />
<br />
Create forms to define the metadata for documents, and integrate associated <strong>Lotus</strong><br />
script agents in the appropriate events (QueryOpen, QuerySave, and son on).<br />
Use XPages to develop the actual user interface, using the respective form(s) as a<br />
data source for the XPage.<br />
Use XPages to develop applications to write applications and support multiple<br />
platforms consistently.<br />
Carefully consider the use of server-side versus client-side data validation to prevent<br />
round-trips to the server for data validation and translation. Use client-side validation<br />
and processing when possible.<br />
Carefully consider the use of the visible property versus rendering to assure that the<br />
information that the user sees, as well as the application functionality, is processed<br />
correctly.<br />
Use custom controls over traditional <strong>Domino</strong> shared design elements (such as<br />
subforms, shared actions, and shared fields) to create reusable user interface<br />
components, business processing logic, and other reusable elements in your<br />
application development efforts.<br />
5.4. Accessibility<br />
Accessibility is a general term describing to which degree an application is available to its<br />
users. It can be understood as the ability to access an application with. While<br />
accessibility in the past was focussing on people with disabilities or special needs, the<br />
current understanding has broadened within the IT industry to focus on a wide range of<br />
different devices with different capabilities each.<br />
The broad definition of accessibility means applications are accessible to a greater range<br />
of devices and applications. These devices and applications can reinterpret compliant<br />
information for a broader audience, for example, into voice by page readers or reuse<br />
through mash ups.<br />
5.4.1 Why to think about accessibility<br />
Your business should think about accessibility for the following reasons:<br />
<br />
<br />
Avoid legal disputes<br />
While many countries have defined accessibility requirements by law (See examples<br />
below), those definitions might not be clearly defined within the requirements<br />
provided in the beginning of your application development project. Not knowing about<br />
these definitions does not prevent from becoming the target of legal action against<br />
you or your company for not ensuring your application is accessible.<br />
Competitive advantage<br />
When building a <strong>Domino</strong> application, you are most likely building it for a defined<br />
152 of 217
audience, a certain type of user or device type. However, think about the audience<br />
you can reach out to if your application would support a broader range of devices or<br />
languages. Especially with mobile devices being a major client type your application<br />
will gain more interest if its easy to access on all different clients and device types.<br />
Enhance your corporate image<br />
Negative reports have been in the press about companies who have not tried to<br />
make their products and services accessible to everyone.<br />
Taking positive action should have the reverse effect and enhance your company<br />
image in the marketplace.<br />
The following examples of legislation have provisions requiring physical accessibility:<br />
In the U.S., under the Americans with Disabilities Act of 1990<br />
In Australia, Disability Discrimination Act 1992<br />
In the U.K., the Disability Discrimination Act 1995<br />
In Germany, the "<strong>Best</strong>immungen für eine barrierefreie Informationstechnik" § 11 BGG<br />
There probably are many more. Check with your legal team to find out what regulations<br />
do apply to your project.<br />
5.4.2 Considerations<br />
While the functionality aspect is often described well, developers are requested to<br />
implement those definitions by using the platform of their choice: <strong>Domino</strong>. Notable<br />
challenges are:<br />
<br />
<br />
<br />
There are legitimate reasons to switch JavaScript support off.<br />
For example, corporate security restrictions filter JavaScript already at firewall level,<br />
or the Firefox plugin "NoScript" is in use to protect people from cross-site scripting<br />
(XSS) or Cross-Site Request Forgery (CSRF) vulnerability.<br />
Many devices ignore JavaScript entirely.<br />
Screen readers do execute JavaScript, however, you may not want them to.<br />
5.4.3 Approach<br />
Building applications for accessibility requires a little change in mindset. While some<br />
issues are quickly resolvable by adding some client side JavaScript, it may be difficult<br />
when thinking about a broader range of devices. So one approach is to think in layers, a<br />
basic functional layer, a CSS (for example, OneUI) style sheet layer to apply a visual<br />
design, and some JavaScript on top to enhance the site's behavior.<br />
While there is a complete documentation available, a little explanation about the how and<br />
why goes a long way. The OneUI is not so much about colors and fonts, but about<br />
structure, navigation, and layout. Following its guidelines, your applications get a<br />
consistent look, which user studies show increase user confidence about their ability to<br />
use your web application. This translates into less help desk calls. Any consistent<br />
framework does that, the advantage of the OneUI is that your applications start looking<br />
consistent to the <strong>IBM</strong> software in use. Furthermore, when <strong>IBM</strong> releases a new visual<br />
style, your application can adopt it in no time.<br />
One remarkable new feature of Notes/<strong>Domino</strong> 8.5.2 and beyond is the consequent use of<br />
Aria tags for accessibility.<br />
153 of 217
Aria tags allow specific devices to identify the purpose of an element on the page,<br />
literally, the role attribute provides information on what the object is.<br />
5.4.4 Usage of Aria tags in XPages<br />
Accessibility tags are defined within the properties of a control. To define them, open your<br />
application in the <strong>Domino</strong> Designer, edit the XPage or the custom control design element,<br />
click All Properties, and look for role under accessibility.<br />
This property implements the W3C ARIA specification on roles that are described further<br />
in http://www.w3.org/TR/wai-aria/#Using_intro.<br />
Screen readers such as JAWS use roles to acquire contextual information about HTML<br />
pages.<br />
For valid values, see http://www.w3.org/TR/wai-aria/#roles and<br />
http://www.w3.org/TR/wai-aria/appendices#quickref<br />
5.4.5 Example<br />
This Edit Box control provides a title and role for accessibility.<br />
<br />
/xp:inputText><br />
5.4.6 What needs attention<br />
Building accessibility can be a broad range. However, it helps to keep a few items in mind<br />
that you can apply:<br />
<br />
Have you checked the sequence of your Tabs<br />
tabindex="x"<br />
154 of 217
How about keyboard shortcuts Did you assign them everywhere do they work as<br />
expected<br />
What about navigation shortcuts for screen readers<br />
Dijit Accessibility (a11y)<br />
http://docs.dojocampus.org/dijit/a11y/indexaction=show&redirect=dijit/a11y<br />
5.5. Graphics<br />
The main best practices consideration as regards graphics is that they may be overly<br />
large or you might have too many of them, resulting in poor performance. But it also<br />
makes sense to pay attention to the quality of the images themselves.<br />
5.5.1 In General<br />
Avoid having multiple copies of the same image; use an image resource design element<br />
or other common resource area so that the user's browser or Notes client can take<br />
maximum advantage of caching.<br />
Try to use PNG files wherever possible. Modern browsers now offer full support to PNG<br />
format which not only supports most of the palette options offered by GIF but is also<br />
much smaller in size. In addition, PNG graphics support use of an "alpha layer," by which<br />
you can make pixels partially transparent. This lets you use the same image on different<br />
backgrounds without worrying about edge effects where the border of your graphic is<br />
jagged, or where there's a "halo" of wrong-color edge pixels.<br />
Always use 100% size of your image. There is no need to scale your images because<br />
even if you do, the browser or client will still download the full image. Therefore, in the<br />
end, your code ends up doing more work rather then less.<br />
NOTE: Because there is such a wide variety of screen sizes and resolutions these days,<br />
in some cases it might make sense to scale graphics down somewhat so that they can be<br />
zoomed in a little without getting jagged or blurry. But be sensitive to the fact that the<br />
browser/client will cache the entire image, and don't use a higher resolution than you<br />
actually need. Don't for instance, make a thumbnail by scaling down a full-screen image.<br />
Have a separate thumbnail file.<br />
Use freely available tools to optimize and analyze image palettes and size, and try and<br />
filter out the unwanted components. This will help you, especially, in low-bandwidth<br />
environments. Some of the tools that you can use are imagemagick, jpegtran, and<br />
pngcrush.<br />
5.5.2 In the Notes Client<br />
When placing graphics on forms and subforms, use image resources rather than pasted<br />
or imported graphics, if there's any chance that the image might be reused.<br />
If not using an image resource, use imported graphics in preference to copy/paste.<br />
Pasting uses a proprietary Notes bitmap format encoding, which is not very efficient.<br />
Importing preserves the original format, so that your efforts to minimize image file size<br />
beforehand aren't wasted.<br />
156 of 217
5.5.3 In Web Applications<br />
For graphics-heavy applications, consider using image sprites which contain a collection<br />
of several images combined into a single image file. You can then use these sprites<br />
through a combination of tags and CSS properties.<br />
Move your more often used resources to the server’s html directory. Loading your files<br />
from the server file system is faster then loading from the individual database, and takes<br />
maximum advantage of browser caching (since all the applications on the server can<br />
share those files). You also have the option of compressing your files using GZip and<br />
then upload them to the server<br />
5.6. Design for target audiences<br />
When building an application, developers have to resolve more than just a business<br />
problem. Today's applications are requested to function on more than just one type of<br />
computer, one type of operating system, browser, or device. The way people work at<br />
their desktop computers is completely different from the way they work on mobile<br />
devices. Each device type has its own benefits and limitations; however, you want to<br />
provide your application to a broad range of user types.<br />
While classic Notes applications are only used by a Notes client, the modern applications<br />
have to serve a variety of client types. Often, the type of client is not even defined when<br />
the application design starts. However, development teams should give thoughts to the<br />
audience for whom they are trying to provide the application.<br />
When design your <strong>Domino</strong> applications, always design with the audience in mind and<br />
consider the who, what, where, where, why, and how.<br />
5.6.1 Who is the target audience<br />
Does your target audience consist of the IT Department with a small set of of mobile<br />
devices Is it the Executive Board who often delegates tasks to their personal assistants,<br />
or are they comprised of warehouse staff working from kiosks Knowing who your users<br />
are will greatly direct the project (and as a result the end-result) to the right direction. It is<br />
extremely critical that you understand both who they are as well as their day-to-day<br />
interaction with the organization.<br />
We recommend creating role-based user profiles -- written bios, not to be confused with<br />
the user roles or profile documents in the <strong>IBM</strong> <strong>Lotus</strong> Notes <strong>Domino</strong> Application<br />
<strong>Development</strong> -- for each of the potential user types. Submit those description for review<br />
to your project champion.<br />
With these profiles in place, you not only confirm your understanding of your solution user<br />
base, but also proactively address any scope creep specific to who will use the<br />
application.<br />
157 of 217
5.6.2 What is the goal<br />
Once the audiences of the application are clarified, find out the goal of the sponsor of the<br />
project. A goal should be described clearly. Too brief of a goal description, such as<br />
"mobilize a given Notes database" is not adequate and can lead many open questions in<br />
application functions required. The goal here should be to address the stakeholders’<br />
goals while ensuring that a user experience that lends itself to the target platforms is<br />
created.<br />
Take an example, a personal address book focuses on the contact management features<br />
only but left out the other functions such as connection documents, locations, accounts,<br />
and so on might be an application with a Contact form that has over 33 input fields<br />
enabled by default. When sizing that down to a mobile device, the users will not be happy<br />
with the result. Usually, someone accessing a group Personal Address Book using their<br />
iPhone or BlackBerry would not care about a given contact's second personal email<br />
address.<br />
There will be compromise, and the mobile user experience, when done right, will not<br />
simply be a port of the rich client <strong>Lotus</strong> Notes or web browser version of the solution to a<br />
320x480 resolution screened mobile device.<br />
5.6.3 Where will they use it<br />
The ideal is "Everywhere". However, this is not an easy task. Consider the following:<br />
Not everyone has decent mobile device coverage. Think about the users who has the<br />
type of reception that could only result from lead-lined walls built for anti-kryptonian<br />
measures. WiFi can also be problematic. Your high speed internet access solution can<br />
fall flat if people receive connectivity errors when they click on that new icon of your<br />
application on their mobile devices. User perception is reality, and errors tell them simply<br />
that it does not work.<br />
Will you need offline or local storage capabilities This depends on connectivity and<br />
coverage considerations and just how critical of a solution you are requested to develop.<br />
Is relying on a local data store that is potentially several minutes out of sync with the<br />
master database an issue Does it pull down system-generated unique and numericallysequenced<br />
IDs Does it need to actively communicate to live systems to function The<br />
answer highly depends on the type of application you are focussing on.<br />
Once you have answered these questions, or at least brought them to the attention of the<br />
project champion who might not have considered that the warehouse staff could go<br />
"offline" when checking for real-time stocked inventory numbers for product substitutions.<br />
Can you grasp the architectural considerations required to even make this solution work<br />
158 of 217
5.6.4 When do they need it<br />
Understanding the delivery expectation for your application, and communicating about<br />
the solution performance potential (whether that is shorter or longer than the project<br />
champion assumes) will help everyone involved. It is about establishing a realist delivery<br />
expectation by breaking the expectations into these categories:<br />
Need to have<br />
Like to have<br />
Nice to have<br />
Make sure that the "Need to have" category addresses the business critical goals that<br />
you previously established. You can set the time line for delivering the items in the "Like<br />
to have" categories based on the available resources. The "Nice to have" items receive<br />
the lowest priority.<br />
5.6.5 Why would your users use it<br />
When answering the "why", the major consideration is "Does the individual user receive a<br />
value from using the application"<br />
If the answer is no -- if the user has to do more work, if the process is now more<br />
complicated, or if this entire exercise is simply because someone told to do so, then the<br />
project is highly possible to be one of the ill-fated projects. Should this be the case, think<br />
seriously about innovation that helps the user to gain some value out of it; or if even this<br />
is not possible: question the project existence.<br />
5.6.6 How can it be done<br />
The final question of "How" is the result of the developers' knowledge of the platform --<br />
using XPages technology.<br />
159 of 217
Chapter 6. Performance considerations<br />
6.1. View index performance considerations<br />
6.1.1 Introduction<br />
Views are the primary consideration in performance. When you're having a performance<br />
issue, views are generally involved somehow.<br />
Most views are indexed automatically by the server, so that they can open quickly when<br />
users want to use them. This means that a poorly designed view will often not be<br />
noticeably slower to open than other views; but it will drag down the performance of the<br />
server and make the server fall behind in its view indexing task, so that all views in all<br />
applications on the server experience a slowdown.<br />
To demonstrate the different techniques of efficient view design and use, we use a test<br />
environment and sample application. For this section (and other sections, as noted), we<br />
have the following environment:<br />
Server:<br />
o <strong>Domino</strong> Server Version 8.5.2 (with FixPack 2 applied)<br />
o Operating System: Windows Server 2008 Enterprise Edition (running in a<br />
Hyper-V environment<br />
o Memory: 4GB RAM<br />
<br />
<br />
o<br />
o<br />
CPU: Intel Zeon Processor (3.33GHz)<br />
Disk: Three disk drives, expanded as follows:<br />
• C: Drive: Operating system<br />
• D: Drive: <strong>Lotus</strong> <strong>Domino</strong> 8.5.2<br />
• E: Drive: <strong>Domino</strong> Transaction Logs (more on this topic in section<br />
6.1.4)<br />
Client:<br />
o <strong>Lotus</strong> Notes and <strong>Domino</strong> Designer 8.5.2 (with the FixPack 2 applied)<br />
o Operating System: Windows 7<br />
o Memory: 4GB RAM<br />
o CPU: Intel Core-Duo (1.8GHz)<br />
o Disk: One C: drive to accommodate the Operating System, and <strong>Lotus</strong><br />
Notes and <strong>Domino</strong> Designer 8.5.2<br />
Application:<br />
For the purposes of illustration, we use the newly-revised <strong>Domino</strong> Discussion<br />
template that is installed with the <strong>Domino</strong> server, as created below:<br />
160 of 217
All references to this section (and others, as noted) are made to the same application,<br />
server, and data set for consistent findings. We create 10,000 documents in the<br />
application (using a <strong>Lotus</strong>Script agent) to show the performance metrics.<br />
Factors impacting view indexes<br />
From an application development perspective, there are many design decision that we<br />
make every day that impact view indexing. Depending on the decisions made, view<br />
indexing (thus, view performance) can be effected. Here, we discuss how the view<br />
indexes are maintained and their performance implication when these design decisions<br />
are implemented:<br />
Column sorting and categorization<br />
Using @Functions, and especially, date/time based functions<br />
Transaction logging<br />
Controlling <strong>Domino</strong> view index maintenance<br />
Using XPages<br />
Now that we have our environment established, let us dive into the topic of one of the<br />
most frequently ignored facets of <strong>Domino</strong> development: the View index.<br />
161 of 217
6.1.2 View index sorting considerations<br />
Each view in a <strong>Domino</strong> application has an index, which is essentially a mini table of information that<br />
<strong>Domino</strong> maintains and uses to determine:<br />
<br />
<br />
<br />
What documents to display in a view<br />
What order the documents appear in<br />
What other column information is displayed in a view<br />
It is our goal to design applications to keep this index as small as possible, for, the larger<br />
the index, the more work that <strong>Domino</strong> has to do – hence, the slower the view response<br />
time will be for the user. How the views are sorted impacts the size of the index. You<br />
have the following view sorting options:<br />
<br />
<br />
<br />
<br />
No sorting<br />
Single column sorting<br />
Multi-column sorting<br />
Dynamic (user-controlled) sorting<br />
You can display a list of view and the size of each view index using the following<br />
command:<br />
HSHOW DATABASE dataBaseName.nsf v<br />
e<br />
Here we show the view index size under each sorting options in the sample application.<br />
No column sorting<br />
The follow figure shows the output of the SHOW DATABASE command on a sample "All<br />
Documents" view which has no sorting applied to any column:<br />
The unsorted view index is 2,612,056 bytes large. This reflects the total size of all the<br />
162 of 217
data displayed in the view columns, plus some overhead for maintaining the list of notes<br />
in the view. As we implement features, we see the index change in size, thus, impact the<br />
overall performance of our application. The index size isn't an absolute indicator of<br />
performance, but as a general rule, the larger it is, the more work it is for the server to<br />
keep up to date.<br />
If you have multiple replicas of a <strong>Domino</strong> application on multiple severs (or clients), each<br />
replica generates its own copy of the view index; the index does not replicate. So it's<br />
quite possible for the size to vary widely between servers, depending how recently the<br />
index has been updated or whether it's ever been generated at all on that server (if not,<br />
you would see a size of zero).<br />
Single-column sorting<br />
To show the impact of adding a sorted column to our application, we select to sort the Date column<br />
in ascending order:<br />
After saving these changes, closing, and re-opening the database, we see the following<br />
size of the view index:<br />
163 of 217
By simply sorting a column, the size of the index increased (in this case, to approximately<br />
2,694,576 bytes). This represents an increase of 3.16% of the size of the view index,<br />
compared to the original, unsorted view index size. When we sort a column in a view,<br />
we are imposing a slight overhead on <strong>Domino</strong> with respect to view indexing and<br />
performance.<br />
Adding a sorted column to a view does not introduce a large index size increase (all other<br />
things being equal), therefore, performance should not be negatively impacted.<br />
Multi-column sorting<br />
Sorting on multiple columns in the same view does increase the size of the view index,<br />
because there is more for <strong>Domino</strong> to consider when parsing and displaying the view.<br />
As an example, we take our previous view and sort also on the Topic column, as shown:<br />
164 of 217
Reviewing the SHOW DATABASE command, we see a noticeable increase in the view<br />
index size:<br />
Note that the index did increase in size (up to 3,022,256 bytes), which is a 15.7%<br />
increase in the size of the view index. In general, sorting on multiple columns has an<br />
impact with respect to view indexing. The performance factor is directly related to the<br />
number of documents which display in the view, and the number of columns that are<br />
sorted.<br />
165 of 217
Dynamic (user-controlled) sorting<br />
Another option available to <strong>Domino</strong> developers is to dynamically sort columns, based on<br />
the desires of the user. Continuing with our application, we configure the application to<br />
allow the user to sort from "hi-to-low" or "low-to-high" for the Date column, as shown:<br />
Upon saving these changes, and, re-opening the application, we see a substantial<br />
increase in the view index size (and increase to 6,796,120 bytes), which produces a<br />
160.18% increase in the size of the index compared to the original, unsorted view.<br />
166 of 217
Therefore, our minor design changes have produced the following with respect to view<br />
indexing:<br />
<br />
<br />
<br />
<br />
No sort options: Index size is 2,612,056 bytes.<br />
Sort on one column: View index size is 2,694,576 bytes (increase of 3.16% over nonsorted<br />
views).<br />
Sort on two columns: View index size is 3,022,256 bytes (increase of 15.7% over<br />
non-sorted views).<br />
Dynamic sorting: View index size is 6,796,120 bytes (increase of 160.18% over nonsorted<br />
views).<br />
<strong>Best</strong> practices<br />
It is not reasonable to design a view without utilizing some type of sorting option.<br />
Without sorting, the applications would be cumbersome for the end-user, data would not<br />
appear in any logical fashion, and the application would, for all intents and purposes, be<br />
fairly useless.<br />
To accommodate performance and usability, consider the following when designing<br />
views for your application:<br />
<br />
<br />
<br />
Consider the view design for performance and scalability.<br />
Since there is significant performance impact, don't automatically make every column<br />
sortable. Use dynamic sorting as needed to give users ways to find documents. Also<br />
consider that the performance impact of one resortable view is less than that of two<br />
separate views. So, if you can eliminate a view by adding a re-sort to another view,<br />
that's a performance win. It's also a UI win, since users are accustomed to being able<br />
to click column headings to sort in various applications. It makes more sense to them<br />
than having to use an outline to choose among lists of the same documents sorted in<br />
a different way. In cases where you do need separate views (for instance, because<br />
you want to use categorization) consider using the view column option that lets you<br />
link to another view by clicking the column heading. This is intuitive for users,<br />
provided the views you link in this way select the same set of documents.<br />
Learn how to use the view column option "Defer index creation until first use." This<br />
minimizes the performance impact of resortable columns by waiting to do the work of<br />
sorting them until someone actually uses that re-sort. The first user to request that<br />
sort may have a long wait, but once the index exists it will be updated automatically<br />
by the server, like regular indexes, so subsequent use is quick. If the index is unused<br />
for a length of time, the index will be erased, saving the server work. It's a good<br />
choice for columns you want to allow to be dynamically sorted, but which you don't<br />
expect to be sorted very often.<br />
6.1.3 Categorization considerations<br />
Categorizing a column (or columns) in a view has been a favorite of <strong>Domino</strong> application<br />
designers for years, allowing us to build views that provide more meaningful data<br />
presentation, ease of use, and ease of navigation.<br />
As an example, we look at our Discussion database entries in a simple, flat-list, noncategorized<br />
format:<br />
167 of 217
Although the view we are looking at is called "By Category", we intentionally removed the<br />
categorization from this view for the purposes of illustration.<br />
Though a flat-list view presents the documents that we need, it's a little intimidating to the<br />
user to have such a long list to choose from. There are a few different ways the user can<br />
navigate the view -- by scrolling, by using the search bar to filter the documents, or with<br />
the "quick search" where they can just start typing to search by whatever column is<br />
currently sorted.<br />
Upon opening the view, <strong>Domino</strong> must use the view index to gather all information about<br />
all the view rows before displaying them on the screen. Compared to a categorized view,<br />
a flat view may be slower to open, especially if Readers fields are used in the application.<br />
With the SHOW DATABASE command, the view index size of the above view is<br />
approximately 2,448,416 bytes. To see the impact of categorizing columns, we first add<br />
a categorized column by using <strong>Domino</strong> Designer, as shown:<br />
168 of 217
Upon saving the view design, and re-opening the database to the "By Category" view,<br />
<strong>Domino</strong> presents the following view:<br />
The categories shown next to the green “twisty” (<strong>Lotus</strong> Redbooks, <strong>Lotus</strong> Technotes) were<br />
created along with the document in our sample database; they are part of the data<br />
entered into the document when it was edited.<br />
Up until this point, we simply categorized a single view on a single column. The resulting<br />
size of the index is as shown:<br />
169 of 217
From an index perspective, our view index size increased from 2,448,416 bytes to<br />
3,334,752 bytes – an overall index size increase of 886,336 bytes (or, 36.2%). While this<br />
increase may seem large compared to the simple change we made to our view design,<br />
we must consider what occurs when we categorize a column:<br />
<br />
<br />
<br />
<br />
A category row is an "entry" in the view table just like a document is. The categorized<br />
column in the document row also contains a copy of the category value (it may be<br />
different because a category contains one value, whereas the field you're<br />
categorizing may contain multiple values).<br />
If a document does contain multiple category values, there are multiple row entries<br />
for that document, which also takes additional space and makes maintaining the list<br />
of entries more work.<br />
Categorization automatically implies sorting, either in ascending or descending order,<br />
so there is view index overhead because of the sort option selected.<br />
When you categorize a column, all documents related to that category are referenced<br />
(or linked) back to the category. This information is stored in the view index to<br />
provide the “parent/child” hierarchy between the category and associated documents.<br />
If we add a second categorized column to the same view (say, on the Author field), the<br />
results are as follows:<br />
170 of 217
Note that we added the Author (Bruce Lill) across all documents, so that we have the<br />
same second-level category value across our application. The results of the view index<br />
size are shown below:<br />
Our view index for the By Category view is now 4,400,924 bytes in size, an increase of<br />
31.97% over a single category, and an increase of 43.55% over a non-categorized<br />
view. As mentioned earlier, the larger the view index, the more work that <strong>Domino</strong> has to<br />
do to maintain that index, and open the view.<br />
In addition to minimizing the view index size, the Collapse all when database is first<br />
opened setting on a view can aid performance. This setting is under the view properties<br />
when you open a categorized view in <strong>Domino</strong> Designer, shown below:<br />
171 of 217
The “Collapse all when database is first opened” setting instructs <strong>Domino</strong> to collapse the<br />
"Twisties" when a view is first opened by a user, thus, instructing <strong>Domino</strong> to display less<br />
information to the user upon view open (for our demo application, <strong>Domino</strong> would show<br />
two categories: <strong>Lotus</strong> Redbooks and <strong>Lotus</strong> Technotes, as opposed to these categories,<br />
the sub-categories, and document column data).<br />
The view will be displayed faster because <strong>Domino</strong> does not have to initially display as<br />
much data to the user. The consideration is that the user must expand a category in<br />
order to see the documents it contains.<br />
<strong>Best</strong> practices<br />
When a design decision calls for the use of categorized views, consider the following:<br />
<br />
<br />
<br />
<br />
Plan categorization carefully, for over-use of categorized views can lead to<br />
performance degradation and database size increases.<br />
If you use categorized views, keep the number of columns per view that you will<br />
categorize on as few as possible.<br />
Use the “Collapse all when database is first use” setting for categorized views.<br />
Because <strong>Domino</strong> must maintain each view index, excessive numbers of categorized<br />
views may drag down the performance of the server generally.<br />
172 of 217
6.1.4 @Functions and view performance<br />
A view column can contain many different types of data: numbers, text, dates, times, and<br />
formulas. When you open a view, <strong>Domino</strong> must apply the following to display the view:<br />
<br />
<br />
The view selection formula that <strong>Domino</strong> uses to determine which documents to<br />
display in the view.<br />
Column formulas that are used by <strong>Domino</strong> to determine the data to display in the<br />
columns for each document.<br />
The <strong>Domino</strong> server tries to save work by storing the view index, including the values of all<br />
columns for each document indexed. When the contents of the view are needed -- for<br />
instance, when a user tries to open the view -- the server only has to look at any<br />
documents which were created or modified since the view index was last updated, to<br />
decide whether they should be in the view and update or insert the row entries for those<br />
documents.<br />
But this cannot work if the selection or column formulas are such that they might give a<br />
different answer at different times even if the document has not been modified. This can<br />
occur if the selection formula or a column formula uses any of the following functions:<br />
<br />
<br />
<br />
<br />
<br />
@Now<br />
@Today<br />
@Yesterday<br />
@Tomorrow<br />
@Accessed<br />
If any of these functions are used, the server cannot assume that the value it calculated<br />
previously is still valid. So, every time the view is used, it creates the view index from<br />
scratch, evaluating the selection formula against every document in the database, then<br />
calculating the column values for each matching document. Naturally, this takes much<br />
longer than just examining recently modified documents.<br />
Some notes regarding this situation:<br />
<br />
<br />
<br />
<br />
This rule applies only to column and selection formulas. Other formulas associated<br />
with the view, such as column hide formulas, action button formulas, and so on, are<br />
not used in calculating the view index, but are instead calculated by the client when<br />
the view is used. You can use @Now in those without any problem.<br />
It would seem to make sense for the <strong>Domino</strong> server to distinguish between the use of<br />
@Now, which always returns a different value, versus @Today, which returns the<br />
same value for 24 hours at a stretch. If only @Today is used, the server really only<br />
needs to recalculate the index from scratch once per day. However, that's not how it<br />
works; @Today is just as bad for performance as @Now.<br />
You may have come across a tip that tells you to use @TextToTime("today") instead<br />
of @Today, for better performance. This is incorrect. You do get better performance,<br />
but the view contents are incorrect. All this does, is fool the view indexer into not<br />
realizing that you're referencing the current date in your formulas. So, the indexer<br />
doesn't know that it has to re-evaluate the formulas against documents that weren't<br />
modified, and the values in the view get out of date.<br />
The @Random function returns a different value every time it's called, but the view<br />
indexer doesn't include it in the functions that force an index rebuild on each use.<br />
That's probably because using the @Random function in a view is kind of weird<br />
173 of 217
anyway, and it's not clear whether there's really a need to re-evaluate it for old<br />
documents.<br />
There are some functions that you might think would be changeable over time, but<br />
really are not. As an example, the @DocNumber function; if there are three<br />
documents in the view, the doc number for the last document is 3; if you create a new<br />
document, and the view sorting puts it at position 2, the old document number 3<br />
becomes document number 4, even though that document hasn't been modified.<br />
There's a trick with @DocNumber and similar functions, though; they actually return a<br />
static string with special codes in it that instruct the client to calculate a value and<br />
insert it at that point. So the value in the server index doesn't change because of<br />
changes to other documents.<br />
There are several other functions, listed in the documentation, that don't work in<br />
views at all. They will not force a rebuild, but they also don't do anything useful.<br />
Any other functions that return or manipulate date/time values, are not a problem.<br />
Feel free to use @Modified, for instance.<br />
As an example of that last point, consider the following formula added to the By Category<br />
view:<br />
The formula used in the "Custom Formula Column" is as follows:<br />
“This document was last modified on ” + @Text(@Modified)<br />
The formula concatenates the string "This document was last modified on" with the result<br />
of the @Modified function, converted to text.<br />
NOTE: We discourage using @Text to convert numbers and dates in view columns,<br />
because this uses the server's formatting settings, overriding the user's formatting<br />
preference. This formula is just an example.<br />
When writing column formulas, no matter how complex, you need only look for the five<br />
174 of 217
functions listed earlier, to determine whether they will force an index rebuild on every use.<br />
In this case we're safe; neither @Text nor @Modified cause a problem.<br />
In the resulting view, we see the following:<br />
Once the view is displayed, you do not have to refresh view index until the following<br />
situations occur:<br />
<br />
<br />
One of the underlying documents is modified.<br />
<strong>Domino</strong> performs maintenance on the view index.<br />
Suppose that we make the following modification to our column formula:<br />
“The current date and time is ” + @Text(@Now)<br />
175 of 217
Now that we're using the dangerous @Now function, the view will be slower. There's also<br />
a visual indication that the view index is considered always out of date, as shown below:<br />
176 of 217
Observe the "view refresh" icon located in the upper-left corner of the view (shown in the<br />
red box below).<br />
This is an indicator that something in the view has changed, requiring an update to the<br />
view index. With normal views, this only occurs if the client notices that some documents<br />
have been modified since the view was opened. In this case, though, what has changed<br />
is @Now. In fact, it is always changing, returning the current date and time (including<br />
seconds and hundredths). This view is in a constant "needs refresh" state.<br />
<strong>Best</strong> practice<br />
When using @Functions in a view column formula or view selection formula, avoid the<br />
functions @Now, @Today, @Yesterday, @Tomorrow and @Accessed.<br />
So then, what do you do if you want a view of "documents created today" We want to<br />
avoid the obvious way of comparing @Created and @Today in the selection formula.<br />
There are a few ways to manage this, depending on how users need to use this view and<br />
how much work you're willing to do.<br />
<br />
<br />
<br />
<br />
Create a view that simply sorts documents by the date/time value, so that the<br />
documents of interest appear at the top of the view. Of course, the view also will<br />
contain a lot of documents you didn't want there, but it may be an acceptable<br />
compromise for best performance.<br />
Create a view categorized by date, and use the "single category" function to display<br />
only today's category.<br />
Use a folder instead of a view. Write an agent that executes nightly on one server,<br />
shortly after midnight, and adds and removes documents in the folder. Folder<br />
membership replicates, so it need not run on all servers. Depending what the<br />
selection criteria are, you might also have to have a "new and modified documents"<br />
agent to assign folder membership for documents created during the day.<br />
If the date-related formula is in a column rather than in the selection formula, use a<br />
"user programmable" column to read the formula from a profile document. Write a<br />
nightly agent to update the formula to contain today's date as a hard-coded value.<br />
177 of 217
Use @Date function to express a date in a way that doesn't depend on the date<br />
formatting settings of the server or client (for a local replica).<br />
The user-programmable column option can also be used for selection, though it is a<br />
bit of a kludge. If a column formula uses @Return, the document is excluded from<br />
the view.<br />
6.1.5 Views and transaction logging<br />
Important note: The use of transaction logging as part of any <strong>Domino</strong> application design<br />
requires consultation with the <strong>Domino</strong> Server administration team prior to<br />
implementation.<br />
The best way that we can describe Transaction Logging is through illustration.<br />
Without transaction logging in <strong>Domino</strong><br />
Without the support of the transaction logging in <strong>Domino</strong>, a server-based <strong>Domino</strong><br />
application is manipulated in the following way:<br />
This introduced many potential problems, especially in the event of a server crash. These<br />
problems include:<br />
<br />
<br />
In the event of a server crash, the <strong>Domino</strong> application is left in an ‘inconsistent<br />
state’. In short, the data in cache was lost, and, the data in the NSF was not written<br />
to completely (between steps 2 and 3, above). Thus, upon restart, the server had to<br />
perform consistency checks on each application. The consistency checks means<br />
that the application could be off-line for minutes to hours, depending on the size and<br />
complexity of the application.<br />
In addition, since the application state is inconsistent, each view index has to be<br />
rebuilt, which, depending on the size and complexity of the application, could take<br />
minutes to hours.<br />
178 of 217
With transaction logging<br />
Since introducing transaction logging, <strong>Domino</strong> has become much more stable and<br />
reliable than ever. Consider the processing of data when transaction logging is enabled:<br />
In the event of a server crash, <strong>Domino</strong> will restart, performing the following:<br />
<br />
<br />
<br />
<strong>Domino</strong> opens the transaction logs, looking for any transactions not marked as<br />
Complete.<br />
If the entire transaction was written to the log, then <strong>Domino</strong> writes the data into the<br />
NSF, marking the transaction in the log as "Complete". This process is called a "roll<br />
forward".<br />
If the entire transaction was not written to the log, then <strong>Domino</strong> puts the data in the<br />
NSF back to the state it was in before that data was edited, and, mark the transaction<br />
‘Failed’. This process is called a "roll back".<br />
The important piece for us to understand is that <strong>Domino</strong> will, when transaction logging is<br />
enabled by the <strong>Domino</strong> Administrator, protect the data from corruption, getting the server<br />
back on-line as fast as possible. However, there is one more piece we have to consider:<br />
view index.<br />
View logging does not impact the view indexing performance unless you explicitly design<br />
your views to do so. By default, the view logging is disabled on a view that you build<br />
using <strong>Domino</strong> Designer. The view logging is enabled through <strong>Domino</strong> Designer, view<br />
properties, on a per-view basis, as shown:<br />
179 of 217
Once enabled, view indexes can now take advantage of <strong>Domino</strong> transaction logging,<br />
assuring that the database is brought back on-line fast, and, the indexes are updated<br />
without a full-scale view index rebuild. Combined with database transaction logging, a<br />
production server can be on-line in minutes after a server crash (instead of hours).<br />
<strong>Best</strong> practices<br />
When using transaction logging and view logging in developing your <strong>Domino</strong> application,<br />
consider the following:<br />
<br />
<br />
Transaction logging must be enabled and configured by the <strong>Domino</strong> Administrator<br />
before view logging can be successfully enabled.<br />
View logging does incur additional overhead on the <strong>Domino</strong> Server, so work with<br />
your <strong>Domino</strong> Administrator to make sure that the server resources (memory, CPU,<br />
and disk) can adequately process view logging requests.<br />
6.1.6 Controlling <strong>Domino</strong> view index maintenance<br />
From the vast amount of information we have learned thus far, we see that view indexes<br />
are an important part of <strong>Domino</strong> application functionality and design. Most of the<br />
maintenance of the index is performed by the <strong>Domino</strong> server (specifically, the UPDATE<br />
and UPDALL server tasks). The application designers have limited control over the view<br />
indexing process, on a per-view basis. The application developers can decide how the<br />
index is refreshed, how it is maintained, thus impacting the performance of the<br />
application.<br />
Each view independently has settings that you can explore, using <strong>Domino</strong> Designer,<br />
which have a direct impact on view indexing, thus, performance of your application. In the<br />
view properties of the <strong>Domino</strong> Designer, select the Advanced tab. The options in the<br />
Refresh dropdown control the view indexing:<br />
180 of 217
Each index option of the Refresh dropdown is described below.<br />
Auto, after first use<br />
This option, which is the default for new views, waits to create a view index until the view<br />
is opened for the first time. After that, the index is kept up to date by the UPDATE<br />
process, unless it should become inactive for a period of time (which you can specify in<br />
the Discard field). At that point the view index is discarded, and no longer kept up to date,<br />
until someone uses it again. The server also updates the view index every time the view<br />
is opened, to make sure to catch any changes made since the last UPDATE pass.<br />
<br />
<br />
Benefit: Active views are kept reasonably up to date, so that users don't have to wait<br />
much for the view to open. Inactive views eventually stop causing extra work for the<br />
server, so that unused databases don't slow your server merely by existing on the<br />
disk.<br />
Consideration: Once users start using the view, its existence causes work for the<br />
server even if the users aren't using it often. Enough views of this type that are in<br />
occasional use, can drag down server performance.<br />
Automatic<br />
The UPDATE process will create an index for this view, and keep it up to date, whether<br />
anyone is using the view or not. In addition, anytime the view is opened, the server<br />
updates the view index to make sure of catching recent changes.<br />
Benefit: The view is always up to date, and opens quickly for the user .<br />
Consideration: The presence of this view causes work for the server even if nobody<br />
ever uses the view. Only select this option if performance is a key concern for that<br />
specific view.<br />
Manual<br />
The view index is never generated or updated automatically. It is created the first time the<br />
view is used, but not updated every time a user opens the view. This option allows the<br />
181 of 217
view to be opened very quickly because the stored index information is displayed without<br />
checking for recent modifications. Since the view index is not refreshed, the data<br />
displayed in the view might not match the data currently in the documents. The user will<br />
likely see the view refresh icon ( ) when they open the view, advising them that the<br />
data are out of date. They can refresh the view by clicking this icon or pressing the [F9]<br />
key.<br />
<br />
<br />
Benefit: The view open quickly, a feature especially useful in large databases.<br />
Consideration: The data may be stale. Refreshing the view index is a manual<br />
operation for the user.<br />
This is a good choice for views whose contents change seldom or never, such as help<br />
documents.<br />
Auto, at most every<br />
This option allows you to control the maximum hourly interval at which the view index will<br />
be refreshed. When selected, the application designer must enter a number of hours<br />
between view index refreshes. Once applied, the view index is refreshed automatically,<br />
but not more often than the number of hours entered. For example, if you set the Auto,<br />
at most every option to four hours, the UPDATE process will refresh the index if it's been<br />
four hours or more since the last update. Like Manual updating, the view index will not be<br />
updated when a user opens the view, but they will see the refresh icon and can manually<br />
refresh. The time between updates may also be more than the selected interval, since<br />
UPDATE is a polled process that scans through all databases repeatedly, and if there's a<br />
lot of work to be done in other databases, it can fall behind.<br />
<br />
<br />
Benefit: The view index is automatically refreshed at controlled time increments.<br />
This can decrease indexing time, and assure that server resources are not being<br />
consumed by a more frequent refresh interval. The view also opens very quickly.<br />
Consideration: When you open a view, the view index is likely stale, and may need to<br />
be refreshed manually.<br />
Because of the combination of rapid access and eventual updating, this is a good choice<br />
for views whose contents change only occasionally, such as keyword documents<br />
accessed by @DbLookup. Even though the database is active generally, we don't need<br />
to update this index with every use; it's acceptable if it takes a few hours in exchange for<br />
better performance overall.<br />
“Discard” Index Option<br />
By default, <strong>Domino</strong> performs an incremental "refresh" of the view index, looking for new<br />
and changed documents since the last refresh and inserting their information among the<br />
existing view entries, or deleting existing entries if the document no longer qualifies for<br />
inclusion. You have the option to “rebuild” the view index, destroying the existing index<br />
and creating a new one from scratch (you can do this manually from the view via<br />
Shift+F9, or via calls to the Notes APIs). Naturally, unless there have been a huge<br />
number of modifications, a refresh is much faster than a rebuild. While it may sound<br />
attractive to "start fresh," you can generally rely on it that the index for any documents<br />
that haven't been modified, is correct and up to date. Use refresh and don't worry about<br />
it.<br />
To control how often the view index is rebuilt from scratch, use the Discard options in the<br />
182 of 217
view properties. See the figure below:<br />
If you "discard" the view index, <strong>Domino</strong> must create the index from scratch the next time<br />
someone wants to use the view. This doesn't make the view more reliable, only slower to<br />
open. The advantages of discarding the index are that it's not taking up space on disk,<br />
and the UPDATE process no longer has to update it, so that frees up server resources.<br />
The options for automatically discarding the view options are described below:<br />
If Inactive For 45 Days<br />
This is the default option. If <strong>Domino</strong> finds that a view is inactive (no users access) for 45<br />
days, it deletes the view index from the application. This can save storage space on<br />
infrequently accessed views. 45 days is a good length of time for most views; if they<br />
become disused for that long, there's a good chance that they'll continue to be disused<br />
for much longer, so there's no point in expending resources to keep them updated.<br />
Note: this option is ignored if the Refresh setting is "Automatic".<br />
After Each Use<br />
This setting instructs <strong>Domino</strong> to not store the view index at all, but to calculate it from<br />
scratch every time the view is opened. This is rarely a good choice, but might be<br />
appropriate in some special cases. This is the same behavior that occurs automatically if<br />
the selection or column formulas use @Now; we know that any stored view index is<br />
immediately invalid because @Now is not the same the next time we look at the view.<br />
If Inactive For<br />
This option is similar to the "If Inactive For 45 Days" setting, except you get to define the<br />
number of days between view index discards. If <strong>Domino</strong> finds that a view is inactive (no<br />
users access) for the number of days specified, it will delete the view index from the<br />
application. This can save storage space on infrequently accessed views, or in case you<br />
know enough about the usage pattern of the view to select a more specific number than<br />
the default 45 days. For example, a view containing sales data that's needed once per<br />
quarter to prepare a report; once it's been inactive for a week, we know they're done with<br />
183 of 217
it until next quarter.<br />
Note: this option is ignored if the Refresh setting is "Automatic".<br />
<strong>Best</strong> practices for Discard settings<br />
<br />
<br />
<br />
Given the important relationship between view indexing and performance, first try to<br />
minimize the number of views when designing your <strong>Domino</strong> application.<br />
For those views you do need, at least consider whether the default indexing options<br />
are appropriate.<br />
In existing applications, if you suspect views are unused but aren't sure enough to<br />
just delete them, set their discard settings to a low number of days to reduce the<br />
performance penalty if someone opens it by accident.<br />
The Database Option "Disable automatic updating of<br />
views"<br />
This option instructs the UPDATE process to skip this database entirely. It's a good<br />
choice for archives and other databases that are not often used. Views with automatic<br />
update options will still be updated when the user opens them, but they will never be<br />
updated or created automatically.<br />
6.1.7 View Externalization<br />
Watch this space.<br />
184 of 217
6.1.8 XPages and views: Your application just got a<br />
whole lot faster<br />
Introduced with Release 8 of <strong>Lotus</strong> <strong>Domino</strong>, XPages offers a new application design<br />
paradigm over traditional <strong>Domino</strong> applications. While the benefits of XPages are many,<br />
we focus on how XPages can help you develop “faster applications faster” with respect to<br />
view design.<br />
To minimize the impact of view design on our application, wouldn’t it be nice if we could<br />
build the same application, with only one view<br />
In this section, we use the sample application that we have been discussing to<br />
demonstrate how to create customized views for an application without creating multiple<br />
physical views using <strong>Domino</strong> Designer. With this process, you minimize design time,<br />
view indexing time, disk space utilization, while maximizing performance.<br />
While it is not consistent with real-world applications to contain only a single view, the<br />
discussion database has that capability if XPages are used as the interface component.<br />
The objective here is to minimize the number of views in the application, thus, to create a<br />
faster performing application. In this example, we have intentionally deleted all views<br />
from the database and use XPages to provide us with the interface to reconstruct much<br />
of the functionality of the original application, using fewer views. See the figure below.<br />
You start by designing a single view, containing all of the rows and columns from our<br />
discussion database, enabling all desired sorting options for each column, as shown:<br />
185 of 217
We now have an All Documents view, which contains all documents for our sample<br />
application. Looking at the view from the Notes Client, we have all documents displayed<br />
in a flat, non-productive format:<br />
We then enable column sorting and categorization on the columns that we want to be<br />
displayed in a sorted or categorized format in the application. Though this adds<br />
overhead to the view index, because the application has only one view, the view indexing<br />
is minimized because we don't need multiple views, and that can increase performance.<br />
XPages applications are able to take advantage of the "click to sort" column options to<br />
quickly re-sort data themselves.<br />
This single-view application has the disadvantage in that it lacks:<br />
186 of 217
Logical information ordering<br />
Ease of navigation<br />
Robustness that users expect in modern applications<br />
We now explore how XPages can give us multiple, useful views of the data presented<br />
above without physically designing another view in the application.<br />
Creating the All Documents view<br />
Earlier, our application contained a view that displayed all documents in the database,<br />
sorted by creation date. Here you build the same single view of your data using XPages.<br />
First you create the XPage called documentsALL.xsp in <strong>Domino</strong> Designer, and insert<br />
the View Control, as shown:<br />
Upon dragging and dropping the View Control onto the XPage, the Select Data Source<br />
for View panel shown asking you to complete certain properties:<br />
187 of 217
The properties are described below:<br />
Show data from: This field instructs the View Control from where to show data. We<br />
use <strong>Domino</strong> view.<br />
Application: The application for this view. We use our demo application. You can<br />
link this View Controller to a view in another <strong>Domino</strong> application.<br />
View: The name of the view to display in this View Controller (the All Documents<br />
view)<br />
Choose <strong>Domino</strong> view columns to display: This is where the power of the View<br />
Controller comes in to play. You can select which columns from the view that you<br />
want to see, ignoring those that you do not.<br />
Since the original All Documents view contained the creation date, author, and subject<br />
fields, we include only those in our XPages design for the All Documents View Controller,<br />
as shown:<br />
188 of 217
Your XPage appears as follows, where you can "tweak" the results to your needs.<br />
Through the View Controller, you can control virtually all aspects of the view display,<br />
including:<br />
<br />
<br />
<br />
The navigation bar at the top allows the user to page through the documents in a<br />
clean, easy to use navigation system.<br />
The view columns can be rearranged to suit your needs.<br />
The view sorting options can be set here on the XPage – a more efficient method of<br />
processing view column sorting than traditional <strong>Domino</strong> views.<br />
NOTE: XPages are not magic; the work of sorting still has to be done at some point.<br />
For example, you can rearrange our columns, as needed, by simple cut and paste<br />
189 of 217
operations. Then, you can open the properties of the Created column and instruct<br />
XPages to sort the data, as shown:<br />
Upon preview, you obtain the following XPage-based view:<br />
Note that we did not make the interface attractive, for our focus is on view design and<br />
performance.<br />
In summary, here is what XPages design brings to views, view performance, and server<br />
resource utilization:<br />
190 of 217
We created one view in <strong>Domino</strong> Designer, thus, <strong>Domino</strong> has one index to maintain.<br />
We inserted the view onto our XPage, using the XPage View Control, removed the<br />
columns we do not want, rearranged the column we do, and sorted on the<br />
appropriate column – giving us the custom view we need without physically designing<br />
another view in the application.<br />
By selecting different sets of columns to display, we can create different front-ends to<br />
the same Notes view. To display different selections of documents, however, you<br />
usually still need different views.<br />
To illustrate the last point, consider building an XPages-based view for the following<br />
views:<br />
<br />
<br />
documentsAuthor.xsp: All documents, sorted and categorized by the Author, and<br />
containing the Subject, Creation, and Last Modified fields<br />
documentsCreated.xsp: All documents, sorted and categorized by the Creation date,<br />
and containing the Subject, Author, and Last Modified fields<br />
Using traditional <strong>Domino</strong> development, you would have to design two additional views, so<br />
the server would have to maintain two additional view indexes. Using XPages, you can<br />
repeat the process above, inserting only the columns you need, giving users three views<br />
from one physical view design.<br />
XPages interfaces have drawbacks as well as advantages.<br />
<br />
<br />
<br />
<br />
It's somewhat more work to design.<br />
Full-text search and other functions that users take for granted in a Notes view, are<br />
not available unless you design them in each time.<br />
It's difficult to navigate longer views, where you may need to advance to the next<br />
page many times to get into the middle of the view. The Notes view's "quick search"<br />
function and the scroll bar that can jump you to any place in the view, are a big help<br />
when working with large amounts of data.<br />
There is no way to do a manual full-text search on the whole view, select all matching<br />
documents, and execute an action on them, if the results are more than one page<br />
long. This is routine in a Notes view.<br />
6.1.9 Summary of the view performance best practices<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Limit the number of views.<br />
Limit the complexity of views -- fewer columns, simpler formulas.<br />
Avoid using @Now, @Today, etcetera in view selection and column formulas.<br />
Take time to consider whether you have set the appropriate indexing options for each<br />
view.<br />
Limit use of user-sortable columns, while bearing in mind that a single re-sortable<br />
view has less performance impact than two views with no re-sort.<br />
Don't allow end-user creation of shared views. The users don't understand the<br />
performance impact of creating views, and may create many duplicates.<br />
Avoid excessive column categorization in the design. A categorized column affects<br />
performance significantly more than a simple sorted column.<br />
When categorizing multiple columns in a single view, it is best to have a single<br />
categorized column, using the value "Column1Value\Column2Value\etc". Because<br />
<strong>Domino</strong> only has to maintain one category index. [really]<br />
191 of 217
When displaying columns that are categorized, or responses that appear beneath<br />
their main document, use the view design option "Collapse View When Database Is<br />
First Opened" to make views open faster.<br />
Using XPages and the View Control can enhance the application performance by reusing<br />
the same view in different display or sort orders, minimizing index maintenance<br />
and size in the application.<br />
Work with your <strong>Domino</strong> Administrator to enable Transaction Logging on the server to<br />
take the advantage of view index logging (a property of the design of each view) to<br />
allow server restart and application availability to be optimal in the event of a server<br />
crash.<br />
The main consideration in designing views, is the tradeoff between giving the user<br />
complete information, and performance of the application and the server.<br />
As a designer, the Rapid Application <strong>Development</strong> (RAD) nature of Notes permits you to<br />
add a view with ease. While at times this may be necessary, you must really think about<br />
simply adding additional views “on the fly” without considering the impact on the overall<br />
application, and, the overall environment.<br />
First learn what tasks users need to do in your application, and think through the<br />
application design. Design each view carefully to give users the information they need for<br />
their specific tasks. Adding unneeded columns and re-sorts hurts performance without<br />
helping the user. Unnecessary columns can even make your application more difficult to<br />
use by cluttering the screen with trivia.<br />
It's quite common to see applications with dozens of views, many of which are probably<br />
unused. Nobody, not the developer, not any one user, knows what all these views are for<br />
or which documents they select. The view name in the outline is often not enough<br />
information for the user to determine what view to use. Even if they go to a given view,<br />
they may not be able to tell whether it contains all and only those documents they need<br />
for their task. This sometimes results in users requesting creation of new views that<br />
duplicate existing views, simply because the name of the existing view doesn't suggest<br />
the task they want to do there.<br />
This can be addressed in part by intelligent design of the navigation area of your<br />
application. You don't have room in the outline to describe the view in detail. What you<br />
can do instead is identify the tasks that different users do in your application, and create<br />
views that directly address those tasks. Sometimes (often, we hope) different groups of<br />
users may find the same views useful. Bear in mind that the label of a view in the outline<br />
doesn't have to be the same as the name of the view, and that multiple outline entries<br />
might point to the same view. Also consider that certain tasks may find it useful to see<br />
multiple views at the same time as a document preview. Perhaps a frameset or<br />
composite application would be helpful. Sometimes, views are identical but for different<br />
sets of actions, directed to different tasks. Consider merging these views and using<br />
action hide formulas based on @UserRoles instead.<br />
If you learn what tasks your users do in your application, and design around those tasks,<br />
you will maximize productivity while also keeping the number of views under control and<br />
being able to tell when a view is obsolete, so that you can delete it and improve overall<br />
performance. If you already have an outline that isn't task-oriented and you want to let<br />
people find views in the old way also, consider a tabbed UI in the navigation space that<br />
would let users select the "legacy" navigation or the new task navigation.<br />
There's no way to directly test whether a given view is unused. As we saw in some earlier<br />
examples, you can view the index information of specific views and tell whether the index<br />
192 of 217
has been deleted for disuse. However, because Notes data are replicated but view<br />
indexes aren't, this information may be different on different servers. Also, especially in<br />
applications with a large number and confusing organization of views, users may open<br />
the wrong view by mistake. So the existence of an index is no guarantee that the view is<br />
needed. If you think a view might be unused and you'd like to delete it, you might add<br />
code to the Postopen view event to display a dialog that the view is to be deleted on such<br />
and such a date if you don't hear from anyone who wants to keep it. Or even delete the<br />
view and change the outline entry to point to a page that says "this view has been deleted<br />
because we didn't think anyone was using it. If you want it back send mail to ___<br />
explaining why you need it. Or, have a look at this other view that we think fulfills the<br />
same purpose: (link here)." If you don't hear from anyone for a while, delete the outline<br />
entry also.<br />
6.2. Collections<br />
In your <strong>Lotus</strong>Script or Java code (including SSJS), you build collections for processing.<br />
There are performance considerations to evaluate both in building those collections and<br />
in processing the collections.<br />
6.2.1 Building collections<br />
There are several methods used to build collections, and each have their pros and cons.<br />
The methods below are applicable to <strong>Lotus</strong>Script code and Java code (including serverside<br />
JavaScript).<br />
NotesDatabase search<br />
Inside the NotesDatabase class (either <strong>Lotus</strong>Script or Java), you can call the search<br />
method to build a collection. This method takes a search string (which is in the form of a<br />
SELECT statement, similar to a view selection formula), a cut-off date (which can be the<br />
keyword Nothing in <strong>Lotus</strong>Script or null in Java), and a maximum number of documents to<br />
return (which can be 0 to return all documents).<br />
The NotesDatabase.search method is generally not the best choice when building<br />
collections. This method doesn't take advantage of existing view indexes or the full text<br />
index. It must open every document in the application to determine whether that<br />
document matches the criterion.<br />
It can be efficient if you use the date/time argument to limit the search only to very recent<br />
documents, because the NSF maintains an internal index of documents sorted by when<br />
modified. But in general, other methods that search a view index or full-text index to<br />
locate documents of interest, will give better performance.<br />
193 of 217
NotesDatabase UnprocessedDocuments<br />
In scheduled agents, using the UnprocessedDocuments method is a fast way to get the<br />
documents that have been modified since the last time the agent ran. You can think of<br />
each agent having its own list of “read” and “unread” documents. If your agent only has to<br />
process new and modified documents, using this method will return the best<br />
performance.<br />
NotesDatabase FTSearch<br />
If your application has a full text index, using the FTSearch method searchs for<br />
documents to process with adequate performance. However, if the application does not<br />
have a full text index, this method performs poorly because an entire full text index must<br />
be built in memory, then searched, then discarded. You may wish to use the<br />
NotesDatabase.IsFTIndexed property and NotesDatabase.UpdateFTIndex to make<br />
certain the index exists and is up to date before you try to use this method. Creating the<br />
index when needed using the CreateFTIndex method, only works for local databases.<br />
One drawback in using the FTSearch method is that there is no way to search for exact<br />
equality. For example, a search of [Subject] = “Test” will find documents where the<br />
subject field is the value “Test”, but also find documents where “Test” is a part the subject<br />
field (such as "Field test status").<br />
Note that the FTSearch method can also be used against a NotesView object to perform<br />
the full text search against just the documents contained in the view. However, it is<br />
generally slower than a search of the whole database. This is because the full-text index<br />
is maintained against the whole database, not against individual views. So to do a fulltext<br />
search of a view, Notes must first search the whole database, then iterate through<br />
the results to see which of those are in the view.<br />
NotesDatabase AllDocuments<br />
This method loads into memory all the data in the whole application. If the application has<br />
a large number of documents, this is a very memory intensive method. It would be more<br />
efficient in this case to use a view that contains all the documents. However, this method<br />
is more efficient than performing a search that results in all the documents in the<br />
application.<br />
NotesDatabase FTSearchRange<br />
The FTSearchRange method is similar to the FTSearch method with one additional<br />
parameter (the starting document to return). The best practices applicable to FTSearch<br />
are also applicable to FTSearchRange.<br />
194 of 217
NotesDatabase GetAllUnreadDocuments<br />
The GetAllUnreadDocuments obtains all the documents that have not been read for the<br />
current user (or, optionally using a parameter, the user name passed in as a parameter).<br />
For your scheduled agents, this is similar to the UnprocessedDocuments method.<br />
However, if the application is not tracking unread marks, all documents are considered<br />
read. If unread marks are not tracked, the UnprocessedDocuments method is a better<br />
choice.<br />
Note that there is also a GetAllReadDocuments methods that returns documents that<br />
have been marked read for the current user or the optional parameter user name.<br />
NotesDatabase GetModifiedDocuments<br />
This method is used to return a collection of documents that have been modified since a<br />
specific date and time. This method performs well because of the internal structure of<br />
<strong>Domino</strong> applications.<br />
NotesDatabase UnprocessedFTSearch<br />
This method first obtains the unprocessed documents in the application, and then<br />
performs a full text search against the collection. There is also an<br />
UnprocessedFTSearchRange method that includes a starting document to return. And<br />
there is an UnprocessedSearch method that is similar to the Search method, except the<br />
collection to search is the unprocessed documents instead of all documents in the<br />
application.<br />
These methods perform slightly worse than their comparable methods because of the<br />
additional overhead of getting the collection of unprocessed documents first.<br />
NotesView GetAllDocumentsByKey and<br />
GetDocumentByKey<br />
If you have a NotesView object that has one or more stored columns (a categorized<br />
column is also a sorted column), you can get a collection documents that match values in<br />
the sorted columns.<br />
The GetAllDocumentsByKey method itself is a good performing method, but a view must<br />
be in memory first. The GetView method in the NotesDatabase object is used to read that<br />
view index into memory before GetAllDocumentsByKey can be used. The GetView<br />
method is an expensive method from a performance standpoint. So, even though<br />
GetAllDocumentsByKey performs well, you have to factor in the expensive GetView<br />
method when comparing methods of getting a collection of documents.<br />
These methods are generally the most efficient way to locate documents by key values,<br />
and it is highly recommended for performance reasons, especially when you have to do<br />
repeated lookups using the same key (because you only have to call GetView once).<br />
These methods can take an array as the key argument, locating only documents that<br />
match all the key values (corresponding to the first however many sorted columns are in<br />
the view).<br />
195 of 217
If the user has re-sorted the view, it does not affect this method. Note, however, that you<br />
can use the NotesView.ResortView method to select which column you would like to<br />
search by, if it is not the default sort column of the view. Note, however, that it's generally<br />
considered a best practice to not do your searches in user-visible views, since these tend<br />
to get changed, and that might affect your code.<br />
NotesDocument Responses<br />
If you have a document in an application that enables specialized response hierarchy<br />
information, this property of the NotesDocument object is a fast way to get all the<br />
immediate responses to the current document.<br />
<strong>Lotus</strong>Script only methods for getting collections<br />
There are a few <strong>Lotus</strong>Script only methods used to get collections. These are from the<br />
<strong>Lotus</strong>Script front-end classes and have no Java equivalent. For more information about<br />
these functions, see the <strong>Domino</strong> Designer help documentation. The methods are:<br />
<br />
<br />
<br />
NotesUIWorkspace.PickListCollection<br />
NotesUIDatabase.Documents<br />
NotesUIView.Documents<br />
6.2.2 Processing collections<br />
Once you have a collection inside your code, you have to process the documents in the<br />
collection. You can process the documents iteratively or sequentially.<br />
Processing collections sequentially<br />
To process a collection sequentially, use the GetNthDocument method.<br />
Important: The GetNthDocument method should rarely, if ever, be used. The<br />
GetNthDocument method uses the first document in a collection as a reference point<br />
every time it is called. It then steps through all the documents until it reaches the Nth<br />
document. For example, if the code is trying to find document number 900 in the<br />
collection, it starts with document 1 and then counts through the rest of the collection until<br />
it finds document 900. If you have to loop through a number of documents, you will<br />
experience better performance processing the collection iteratively.<br />
Processing collections iteratively<br />
To process a collection iteratively, you either start with the first document of the collection<br />
and then process the next document, or you start with the last document of the collection<br />
and then process the previous document. The methods used are:<br />
196 of 217
GetFirstDocument and GetNextDocument<br />
GetLastDocument and GetPrevDocument<br />
In <strong>Lotus</strong>Script, the GetNextDocument and GetPrevDocument methods take a parameter<br />
of the reference document in the collection. In Java and SSJS, the preferred method is to<br />
omit the parameter and loop through the documents. The example code loops through all<br />
the documents in the database:<br />
try {<br />
DocumentCollection dc = null;<br />
// You must create the collection before this code will actually work<br />
Document tmpdoc;<br />
Document doc = dc.getFirstDocument();<br />
while (doc != null) {<br />
// Document processing goes here<br />
tmpdoc = dc.getNextDocument();<br />
doc.recycle();<br />
doc = tmpdoc;<br />
}<br />
} catch(Exception e) {<br />
e.printStackTrace();<br />
}<br />
6.2.3 Manipulating collections<br />
In addition to processing collections, you can manipulate collections by adding or<br />
removing documents from the collection. To add a document to the collection, use the<br />
AddDocument method. To remove a document from the collection, use the<br />
DeleteDocument method. There are also methods Merge, Intersect, and Subtract which<br />
are used to manipulate two collections and return a brand new collection.<br />
Note that there is almost no difference, from a performance standpoint, between the<br />
methods to manipulate collections. For example, if you have a document and you want to<br />
add it to a collection, you can use either the AddDocument method or the Merge method<br />
to manipulate the collection.<br />
6.2.4 Additional collection objects<br />
In addition to the NotesDocumentCollection object, there are two other objects which<br />
handle collections of documents.<br />
NotesNoteCollection object<br />
The NotesNoteCollection object is similar to a NotesDocumentCollection object, with the<br />
exception that the NotesNoteCollection object can contain design elements in addition to<br />
documents. There are Add, Intersect, and Remove methods to manipulate the contents<br />
of the collection. Performance with this object is similar to the NotesDocumentCollection<br />
object.<br />
197 of 217
NotesViewEntryCollection object<br />
Inside the NotesView class, there is the AllEntries property and the GetAllEntriesByKey<br />
method that return a NotesViewEntryCollection object. This object contains documents,<br />
just like other collections discussed in this article. However, the documents in these<br />
collections are sorted based on the view criteria. If your code needs sorted documents, it<br />
will generally be faster to use a NotesViewEntryCollection object rather than trying to sort<br />
a NotesDocumentCollection or NotesNoteCollection in your code.<br />
Keep in mind that, since you are accessing data through a view, it is a best practice to set<br />
the AutoUpdate property in the view to False to get the best performance. This property<br />
prevents the code from checking to see if the index in memory is out of date and updating<br />
the index if there was a change. If you have to ensure the latest index in your code, then<br />
use the Refresh method in the NotesView object at the appropriate time to get the latest<br />
index.<br />
6.3. Documenting data access<br />
Once you have a document (NotesDocument in <strong>Lotus</strong>Script or Document in Java or<br />
server-side JavaScript), you might need to read field values off that document. This<br />
section describes the best practices for accessing data off a document.<br />
6.3.1 <strong>Lotus</strong>Script methods<br />
There are two ways to access data from a document in <strong>Lotus</strong>Script. The first is through<br />
something called the Extended Syntax and the second is through the GetItemValue<br />
method in the NotesDocument class. From a performance standpoint, both methods take<br />
a similar amount of time. However, there might be other reasons for choosing one over<br />
the other.<br />
Extended syntax<br />
The extended syntax is a way to directly access a field by its name. For example, to read<br />
the value of the “form” field off a document, the following statement uses the extended<br />
syntax:<br />
result = doc.Form(0)<br />
198 of 217
GetItemValue method<br />
The GetItemValue method takes a parameter of the field name. It returns an array of<br />
values where the data type of each value depends on the data type stored in the<br />
document. Many developers will quickly access the first value of the array in their code.<br />
For example, the two code blocks below return the first value of the “Form” field off the<br />
document:<br />
result = doc.GetItemValue("Form")(0)<br />
and<br />
resultArray = doc.GetItemValue("Form")<br />
result = resultArray(0)<br />
C<br />
Comparing extended syntax to GetItemValue<br />
The performance comparing GetItemValue and the Extended Syntax is nearly identical.<br />
Choosing which method to use comes mainly down to personal preference.<br />
The major advantage to using the extended syntax is the number of keystrokes required<br />
to enter in the statement. Although, with type-ahead available in <strong>Domino</strong> Designer, the<br />
GetItemValue method can be automatically completed for you in a few key strokes.<br />
One disadvantage to using the extended syntax is using a field name that might, in a<br />
future release, become a method or property name. For example, the MarkRead method<br />
was introduced in <strong>Domino</strong> 8 Designer. If your code previously accessed a field called<br />
MarkRead with the extended syntax, that would no longer work on a <strong>Domino</strong> 8 client or<br />
server.<br />
One advantage to using the GetItemValue method is portability to Java.<br />
6.3.2 Java methodsJava methods<br />
Inside Java and server-side JavaScript , the Document class has several ways of reading<br />
data, depending on the type of data being read. The getItemValue method returns a<br />
vector containing all the elements. The getItemValueDateTimeArray method is used to<br />
read date time values or a single date time value. However, if there is only a single nondate<br />
time value in the field, quicker access to the value is through one of the other<br />
methods listed below:<br />
<br />
<br />
<br />
getItemValueDouble<br />
getItemValueInteger<br />
getItemValueString<br />
199 of 217
6.3.3 Avoid Opening Notes Unnecessarily<br />
When processing documents obtained from a view (either by a key search or by iterating<br />
through the view) it is more efficient to access information about the document using the<br />
NotesDocument.Columnvalues or NotesViewEntry.Columnvalues property rather than<br />
referring to a field directly. Column information can be obtained from the stored view<br />
index, without having to access the note data, so it is faster.<br />
6.4. Readers field and view performance<br />
As one of the most used document-level security features, the Readers fields allows you<br />
unparalleled document (record) level security in the <strong>Domino</strong> applications. This section<br />
offers a review of the Readers field and how the Readers field secures <strong>Domino</strong> data,<br />
some of the performance pitfalls that you might encounter if you use them in conjunction<br />
with poor view design, and how you can overcome these performance limitations.<br />
When define a field on a form with the data type “Readers”, you can enter one or more<br />
canonical Notes names into the field, thus, restricting whether the view returns the<br />
document for display and subsequent reading. You are not limited to one Readers field<br />
on a form. If you deploy more than one Readers field on a single form, <strong>Domino</strong><br />
aggregates these fields into one “Master” reader list. Any name that appears in an<br />
Authors field, also has read access to the document.<br />
The names may be individual user or server names, role names, or group names (of<br />
groups defined in the <strong>Domino</strong> Directory). It's considered a best practice, to avoid<br />
hardcoding user or group names into your application. Doing so would prevent reuse of<br />
the application by a different group of users, and would complicate maintenance. The<br />
ADMINP process can find and update names in documents, when users or groups are<br />
renamed. But if the name that's out of date is in a formula in a computed field, ADMINP<br />
can't fix it. Use roles, or else store names in configuration documents, so they can be<br />
managed by the servers.<br />
Note we are not saying that you shouldn't store user and group names in these fields.<br />
Merely that the names should not be part of a formula or other code in your application.<br />
Letting the user select names from the <strong>Domino</strong> Directory, or using the @Username<br />
function in a formula of a Readers field, are perfectly fine.<br />
The following is an example of using more than one Readers field on a form:<br />
<br />
<br />
<br />
<br />
The document is normally considered private for the original author, so a computedwhen-composed<br />
Readers field has the formula @Username, allowing the user to<br />
see their own document.<br />
An editable Readers field on the same form lets the user select one or more names<br />
from the <strong>Domino</strong> directory, of people they want to share the information with.<br />
An Authors computed field has a formula based on the Status field of the document,<br />
which supports a workflow process by calculating the name of the next approvers. An<br />
Authors field is used here because the approvers must have access to modify the<br />
document, to approve it.<br />
To insure that the servers and server administrators have access to all documents, a<br />
computed-when-composed Authors field contains the formula "[Admin]". [Admin] is a<br />
role name which you would have to define in the database ACL. It makes sense to<br />
200 of 217
use an Authors field for this as a general rule, rather than a Readers field, because<br />
often there are cases of optional Readers fields -- the field may be left blank, allowing<br />
access for all, but if you also have a non-blank "admins" Readers fields, then only the<br />
administrators will have access.<br />
Once saved to the application, when a user accesses the document through a view, the<br />
document will not be visible to the user if his canonical name is not in one of the Readers<br />
fields. This is true even for documents created by that user.<br />
Note: If you configure Full Access Administration on the <strong>Domino</strong> Server document,<br />
and open a database through the <strong>Domino</strong> Administrator with Full Access Administration<br />
enabled, you can view and edit any document in the application, regardless of Readers<br />
fields. For more information, see <strong>Domino</strong> Administration Help, and search on "full<br />
access administration".<br />
6.4.1 View and Readers fields<br />
To understand the impact of Readers fields on performance, you have to think about how<br />
documents are stored in a view and how the view is displayed to users. In summary:<br />
<br />
<br />
For a server view, the view index is shared among all users. The server creates or<br />
updates the index without knowing who will use the view next.<br />
When a user opens the view, if the documents contain Readers fields, the server has<br />
to decide which of the documents this user has access to view. So <strong>Domino</strong> scans the<br />
view index to create a subset of documents and associated column values to display<br />
for that user. We call this the working set.<br />
When encountering a document that contains one or more Readers fields,<br />
<strong>Domino</strong> compares the values in those fields and any Author fields, against<br />
the list of names, roles and group names associated with the current user. If<br />
there is a match, the document is added to the working set.<br />
Also, of course, any documents that don't contain Readers fields are added<br />
to the working set.<br />
Once the working set is computed, it must be refreshed again before it is<br />
displayed. ()<br />
It is in <strong>Domino</strong>’s use of the special filter and post-filter indexing operations that,<br />
depending on the use of Readers fields, the number of documents to be displayed in the<br />
view, and the column data used in the view design, there might be a negative<br />
performance impact when opening a view. The more documents that have Readers<br />
fields, the more work must be done to determine which ones the current user has access<br />
to. And, the more values there are stored in the Readers fields, and the more groups the<br />
user belongs to, the longer each individual document test will take.<br />
6.4.2 <strong>Best</strong> practices in using reader fields effectively<br />
To design views to display documents using Reader fields for optimal performance,<br />
consider the following techniques:<br />
<br />
<br />
<br />
Categorized columns<br />
Embed the view on a Page or Form using the single category option<br />
Local replicas<br />
201 of 217
Categorized columns<br />
If you have views in you applications that display documents utilizing Readers fields,<br />
consider categorizing the view and enabling the "Collapse View When Database Is First<br />
Opened" view design property. This allows <strong>Domino</strong> to more quickly process the<br />
documents to display in the view (because <strong>Domino</strong> only has to initially show the column<br />
containing the category, not multiple fields from multiple documents).<br />
The consideration for taking this approach is that the user must then expand the category<br />
to obtain access to the data (and the document), which can take time depending on the<br />
number of documents in the category since the Readers fields in the category's<br />
documents must be evaluated at that time. But this is faster than evaluating all the<br />
documents in the view.<br />
Of course, this does mean that there may be category headings displayed, which don't<br />
contain any documents that the user has access to. Depending on the application and on<br />
which columns are categorized, this may be considered a security exposure, because the<br />
user can tell that there are documents containing the displayed value, even though they<br />
can't see the documents themselves. There's an option to hide categories that contain no<br />
documents the user has access to, but then you lose the performance advantage.<br />
Embed the view on a Page or Form using the single<br />
category option<br />
If the user mainly has read access only to "their own" documents, identified by their name<br />
stored in a field, you can give them a "my documents" view by categorizing the view by<br />
the field that contains the usernames. Embed this view on to a Page and use<br />
@Username or @v3Username in the "Single Category" formula of the embedded view to<br />
select only the category containing the user's documents.<br />
The benefit of this technique is that the view will display quickly, for <strong>Domino</strong> only has to<br />
show documents belonging to the user (the single category), and doesn't have to<br />
consider whether the user has access to documents in all the other categories.<br />
The consideration of this technique is that application maintenance will be greater<br />
because you lose “native” access to the view, thus, must develop the page to provide the<br />
functionality you need (for example, expanding and collapsing the view).<br />
Local replicas<br />
Another technique to optimize view performance with respect to Readers fields is to<br />
maintain local replicas of applications on your workstation. Replication assures that only<br />
the documents that you must have are replicated down to your local workspace, because<br />
the server only the sends the client documents which the user has read access to.<br />
For example, if there are 100,000 documents in the server-based application, and, you<br />
only have Readers access to 10,000 of those documents, the local replica contains<br />
1/10th of the number of documents that the server-based application has, thus, indexing<br />
will be more efficient and view performance will be increased. In addition, local replicas<br />
tend to be more efficient even when they don't contain fewer documents.<br />
202 of 217
Considerations for using this technique include replication latency (that is, access to<br />
documents may not be in ‘real-time”), and, application maintenance -- the support of<br />
multiple application replicas residing on the server and on client workstations.<br />
Direct Access to Document<br />
Another way to avoid view-indexing delays in accessing a user's document, is most<br />
appropriate for applications where the typical user has access to just a single document.<br />
You don't give the user access to any views; instead, when they open the application, it<br />
finds the one document to which they have access, and opens that in a document<br />
window. This might also be done by emailing the user an automatically generated memo<br />
with a doc link to their document.<br />
6.5. <strong>Domino</strong> application scalability<br />
The <strong>Domino</strong> applications (single NSF) are supported up to 64-GB in size on the Windows<br />
and UNIX platforms. This section describes certain best practices for scaling the<br />
application for maximum accessibility and performance, including various application<br />
settings and deployment scenarios.<br />
Fundamental scalability techniques<br />
At the application level, you can use the following techniques to assure maximum<br />
application scalability:<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Limit number and complexity of views.<br />
Avoid unnecessarily modifying documents, and avoid deleting documents and then<br />
creating documents exactly like the ones you just deleted.<br />
Database properties that can impact the overall size (see below).<br />
Database quotas<br />
Archive documents<br />
Selective replication<br />
Deletion stubs - limit how long they are kept (but bear in mind that this will affect<br />
replication)<br />
User activity logging (slows things down)<br />
Soft deletions<br />
Advanced scalability techniques<br />
These techniques are typically used for applications that have large numbers of users<br />
who rely on the <strong>Domino</strong> web engine to access the application, and, for applications that<br />
may exceed the 64GB limit imposed above:<br />
<br />
<br />
<br />
<strong>Domino</strong> clustering<br />
Internet clustering<br />
Store the data in an external relational database management system using <strong>Domino</strong><br />
Enterprise Connection Services (DECS) and <strong>Lotus</strong> Enterprise Integrator (LEI)<br />
6.5.1 Application compaction<br />
203 of 217
Compaction is a process used by the <strong>Domino</strong> Server (and Notes Client) to perform many<br />
maintenance functions on a <strong>Domino</strong> application. For the purposes of our discussion, we<br />
focus on the <strong>Domino</strong> Server commands for application compaction, and, discuss the best<br />
practices for getting the most out of application compaction.<br />
The compact command is invoked by using the following command syntax:<br />
<br />
From the server console:<br />
LOAD COMPACT ApplicationName.NSF –Options<br />
<br />
From a Notes client:<br />
a. Open a command prompt.<br />
b. Using the CD command, change to the <strong>Lotus</strong> Notes program directory. For<br />
example, CD "\Program Files\<strong>IBM</strong>\<strong>Lotus</strong>\Notes"as<br />
c. Run NCOMPACT ApplicationName.NSF –Options<br />
For the complete list of Compact server command line options, see the TechNote #<br />
1084388 at the <strong>Lotus</strong> Notes Support web site at http://www.lotus.com/support<br />
204 of 217
6.5.2 Application properties for scalability<br />
Each <strong>Domino</strong> application maintains an independent set of properties that control<br />
applications features, and application performance and scalability. You can access these<br />
properties from File -> Application -> Properties menu, then select the Advance icon<br />
( ), as shown:<br />
205 of 217
Given the numerous possible application design scenarios, here we focus our discussion<br />
on general best practices for using the relevant properties which impact application<br />
scalability and performance. The following table shows a summary of the key application<br />
properties, from the <strong>Lotus</strong> Notes 8.5.3 C5 Beta Help. You must compact the application<br />
after enabling sand disabling one or more of these settings.<br />
6.5.3 On-disk structure level<br />
With each major release of <strong>Lotus</strong> <strong>Domino</strong>, <strong>IBM</strong> adds functional and performance<br />
enhancements to the database file. Each version of <strong>Domino</strong> ships with the same<br />
standard database file format, which is referred to as the on-disk structure (ODS). The<br />
on-disk structure level of a <strong>Domino</strong> application is an important consideration in any<br />
application deployment.<br />
For example, the <strong>Domino</strong> Attachment and Object Service (DAOS) is a storage method<br />
whereas all file attachments are stored in a single repository and referenced as needed.<br />
This saves storage in the NSF and on your <strong>Domino</strong> server.<br />
206 of 217
To use DAOS, you must have you mail databases set to, at a minimum, ODS 50. If an<br />
application is set to a lower ODS level, you cannot access the <strong>Domino</strong> application<br />
property that relates to DAOS, as shown:<br />
To upgrade server-based applications to ODS 51, the latest ODS version for <strong>Domino</strong><br />
8.5.3, issue the following console command:<br />
LOAD COMPACT –c <br />
To have Notes automatically create new databases using ODS 51, add the following<br />
parameter to the NOTES.INI file:<br />
Create_R85_Databases=1<br />
207 of 217
<strong>Best</strong> practices for on-disk structure management<br />
<br />
<br />
<br />
<br />
<br />
<br />
<strong>Domino</strong> applications should always be upgraded to the latest supported ODS level.<br />
The ODS level does not replicate, therefore, you must plan to upgrade all<br />
applications on all machines – client and server.<br />
For Servers, the ODS level should be set to the highest level supported by that<br />
version of <strong>Domino</strong>.<br />
For Clients, the ODS level should be set to the highest level supported by that<br />
version of the Notes Client.<br />
To have new <strong>Domino</strong> applications created using ODS Level 51, enter the<br />
Create_R85_Databases=1 parameter in the NOTES.INI file.<br />
To upgrade existing <strong>Domino</strong> applications to ODS 51, issue the console command<br />
LOAD COMPACT –c .<br />
6.5.4 Attachment handling<br />
As a true rich information store, a <strong>Domino</strong> application can handle a variety of data (text,<br />
numbers, graphics, and attachments) quickly and easily. From a usability standpoint,<br />
attachments can degrade system and application performance, unless care is taken to<br />
properly handle applications containing many attachments.<br />
Attachment considerations<br />
If your applications require extensive use of file attachments (such as spreadsheets,<br />
documents, presentations, PDF files, and so on), you must carefully look at various<br />
settings that can impact the performance of both the application and the system as a<br />
whole.<br />
These considerations include the number of attachments, the types of attachments,<br />
search options, and methods that you can deploy to help <strong>Domino</strong> more efficiently handle<br />
these operations on your application.<br />
Attachment consideration: Number of attachments<br />
As the number of attachments grows, our application must manage and maintain them.<br />
In the case of electronic mail, this problem becomes even more cumbersome.<br />
If you e-mail a 20K document to 10 users, as a messaging system, <strong>Domino</strong> by default,<br />
stores ten copies of that document on the <strong>Domino</strong> server (one for each recipient).<br />
Therefore, the 20K document has ballooned to 200K of storage for <strong>Domino</strong> to manage.<br />
While this example may seem trivial, consider multiplying this over an average number of<br />
e-mails per day, and, the average number of recipients in an organization.<br />
208 of 217
To help solve this issue, <strong>Domino</strong> 8.5 allows you to enable the <strong>Domino</strong> Attachment and<br />
Object Service (DAOS). This service, when configured properly, can eliminate the<br />
problem outlined in the previous scenario by allowing <strong>Domino</strong> to store only one copy of<br />
the attachment in a separate repository. The functionality is best shown by example:<br />
Attachment consideration: Full-text indexing<br />
As a complete search solution, the full-text indexing is not only index the documents but<br />
the attachment content as well, causing excessive use of storage to store the full-text<br />
index (located, by default, in the sale directory as the application, but stored in a separate<br />
folder named databaseName.ft folder). This fit folder contains the full-text index that<br />
<strong>Domino</strong> uses to search for information, and can quickly balloon to more than the size of<br />
the actual application itself.<br />
As developers, you must decide whether you want <strong>Domino</strong> to index the file attachments.<br />
This can be controlled using the <strong>Domino</strong> application properties box, as shown:<br />
209 of 217
You can tell <strong>Domino</strong> whether you want to index attachments. The benefit of indexing the<br />
attachment is that search results will be more accurate because you are searching the<br />
document and the physical attached file. The considerations include the size of the<br />
index and the increase in time that searching will take (because of the additional<br />
attachment information that has to be indexed), and, that index management time will<br />
increase due to <strong>Domino</strong>’s need to index the Notes document, and, the attached files.<br />
Tip: If you do not want to index the attachment, but, still need to search the textual<br />
contents of the attachment, you can contact the application vendor to see if they have an<br />
application programming interface (API) to access the contents of the attachment. You<br />
could then write an agent (possibly in the QuerySave event of the form) that would<br />
extract the textual data from the attachment and store it in a hidden field within the<br />
document. Then, when you search the document, you are also searching the<br />
attachment text, but, without the excess performance hit of actually indexing the physical<br />
attachment. The trade-off being that the application increases in complexity, and that<br />
you are storing the textual information from the attachment twice – once in the physical<br />
attachment, and again in the Notes document.<br />
6.5.5 Multi-database applications<br />
While it would be optimal to have a <strong>Domino</strong> application comprise of a single storage<br />
facility, this may not be possible due to the complexity of the application, the number of<br />
documents, attachments, indexing, and design maintenance issues that can arise.<br />
In instances where an application simply gets too big for you (or <strong>Domino</strong>) to efficiently<br />
manage and maintain, you have the option to break the application into separate<br />
database files, working in tandem to form a complete, cohesive application experience.<br />
The benefit of a multiple-database application is that information can be more efficiently<br />
processed by <strong>Domino</strong>. The consideration is that application integration from a <strong>Domino</strong><br />
developer’s viewpoint can become more complex. As an example, consider a Sales<br />
Force application, defined as follows:<br />
While this might appear to be a trivial application, consider the performance of the<br />
application with respect to:<br />
<br />
<br />
<br />
The number of views per data item (contacts, quotes, and so on)<br />
The number of attachments for customer documentation<br />
The overall number of documents housed in this application<br />
210 of 217
From a performance and scalability perspective, it might be feasible to design the<br />
application using multiple data stores, as follows:<br />
Some considerations when building multiple-database applications include:<br />
<br />
<br />
<br />
"Relational" database management:<br />
In a multiple-database application, it is not uncommon for a document in one<br />
database to be related (or linked) to another document in another application. While<br />
<strong>Domino</strong> is not a Relational Database Management System (RDBMS) in the<br />
traditional sense, it is possible to link documents together using the Document<br />
identifier (DocumentID) uniquely assigned to each document or another unique value<br />
designed by the application developer.<br />
Application complexity and maintenance:<br />
The application complexity and design maintenance will be more difficult because<br />
cross database references are required to be considered.<br />
Searching:<br />
To effectively search for information, you have to implement a multi-database search<br />
(for example, implementing multi-database search in <strong>Lotus</strong> <strong>Domino</strong>)<br />
Overall, and over time, the application performance will improve in the multi-database<br />
implementation. Your job as a developer will be more challenging, but, if you consider<br />
the performance and scalability advantages of a multi-database implementation of our<br />
applications, the benefits can far outweigh other factors.<br />
211 of 217
6.6. Administration considerations<br />
Although this guide is indirected at the <strong>Domino</strong> Developer, knowing basic administrator<br />
skills is beneficiary in developing applications. After all, a developer can directly impact<br />
the performance of the server. This section describes certain settings that, although<br />
controlled by the administrator, might need adjustment depending on the intended use of<br />
the server from a development standpoint.<br />
6.6.1 Java heap size<br />
In <strong>Domino</strong> 8.5, a notes.ini parameter was automatically added to the <strong>Domino</strong> server:<br />
HTTPJVMMaxHeapSize=256M<br />
This parameter was added to control memory allocation to allow the new XPages<br />
functionality to work correctly. Previously, the maximum heap size was 64 MB. Starting<br />
in <strong>Domino</strong> 8.5.2, the default value for the Java heap size was set to 64 MB, with a<br />
maximum of 256 MB.<br />
The <strong>Domino</strong> Administrator should work with the <strong>Domino</strong> Developer to determine a<br />
suitable Java heap size. The appropriate setting most likely depends on your use of<br />
XPages:<br />
If you are not using XPages applications at this time, 256 MB is too much memory to<br />
allocate to the Java heap. The HTTPJVMMaxHeapSize value should be set to 64M<br />
(64 MB).<br />
If you are exclusively using XPages applications, you may want this value set to 256<br />
MB to support the additional demands on memory that XPages require. To prevent<br />
<strong>Domino</strong> from resetting the value back to 64 MB (prior to <strong>Domino</strong> 8.5.2), an additional<br />
notes.ini parameter is required:<br />
HTTPJVMMaxHeapSizeSet=1<br />
212 of 217
6.6.2 Scoped variables<br />
As described in 4.10 Scoped variables, heavy use of scoped variables in an XPage<br />
application can affect the memory usage (and, thus, performance) of your <strong>Domino</strong> server.<br />
If using sessionScope and applicationScope variables, the default time out period is<br />
around 30 minutes. You can increase or decrease these amounts through application<br />
settings:<br />
Increases to these values mean that the variables will remain in memory for longer<br />
periods of time, which could have a negative impact on performance.<br />
The down side of a short timeout is that the user may be annoyed because they were in<br />
the middle of something, went to lunch or whatever, and the server logged them out.<br />
Gauge the appropriate value for this parameter based on your understanding of how<br />
people will use the application, expected server load, and total number of users of the<br />
application expected in a given period of time. For instance, a website for use by the<br />
general public, with thousands of subscribers, may need a short timeout compared to,<br />
say, a call center application where the same 100 people are using the application all day<br />
long.<br />
6.6.3 Do not allow simple search<br />
Code that does full text searches to build collections should be run against applications<br />
that have a full text index built and maintained by the <strong>Domino</strong> server. There is an<br />
application setting called “Don't allow simple search” that prevents a full text search from<br />
being performed against an application that does not have a full text index. This means<br />
that if you have a scheduled agent that does a full text search, and this property is<br />
enabled, your scheduled agent will fail. Without the property, the agent would build a<br />
temporary full text index in memory, search that index, and continue processing. This is<br />
very inefficient and can be very resource intensive on the <strong>Domino</strong> server. You should<br />
make sure that any time a full text search is going to be used in an application, there is a<br />
full text index created for that application.<br />
The setting also affects users who may do searches in your application. In the Notes<br />
client, any user can open a search bar in a view and try to do a full-text search. If there is<br />
213 of 217
no full-text index, these user-initiated searches can be very resource intensive, so<br />
enabling this option prevents user actions from tying up the server.<br />
6.6.4 Design and document compression<br />
In order to reduce the disk spaced used by your application, you should enable the<br />
application property “compress database design”. This feature requires that the on disk<br />
structure (ODS) of the application be ODS 48 or later. Once the setting is enabled, you<br />
should work with your administrator to schedule a copy-style compact of the application<br />
to compress the design of existing design elements.<br />
Furthermore, if your application contains large rich text fields, then enabling document<br />
compression is also a best practice. If your application has little or no rich text data, then<br />
it is best to not enable document compression. Again, the application must be at ODS 48<br />
or higher, and a copy-style compact is required to compress existing document data.<br />
6.6.5 Attaching large files with a browser<br />
If you are designing a web application where potentially large file attachments are to be<br />
added to documents through a browser, you should work with your administrator.<br />
Attaching large files using web browser can create out of memory conditions on the<br />
<strong>Domino</strong> server. There is a notes.ini entry called <strong>Domino</strong>MultiPartPostBufferSize that can<br />
be used to control the size of the memory buffer used to process multi-part form data.<br />
You should work with your administrator to determine the appropriate value for this<br />
notes.ini entry.<br />
214 of 217
6.6.6 User creation of views<br />
As shown above, two ACL options can grant users access to create personal views on<br />
the server, or to create shared views on the server.<br />
If you give ordinary end users these accesses, they may cause performance issues on<br />
your server by creating many views that will cause server slowdowns because of all the<br />
resources allocated to keeping the view indexes up to date. In addition, there's a potential<br />
security exposure that you should be conscious of.<br />
If there's a legitimate need for a view, it's generally better for the end user to work with a<br />
developer to make sure the view fits into the UI scheme of the application, doesn't<br />
duplicate existing functionality, and is designed to minimally accomplish the needed task<br />
(e.g. that it has just the columns needed, not a column for every field on the form). Only<br />
trusted users who know what they're doing should be granted access to create shared<br />
views. Otherwise, you may see a proliferation of overly complex views that make a lot of<br />
work for the UPDATE task and cause slowdown of the server generally.<br />
The performance penalty for "server private" views (the first of the two checkboxes) is<br />
less of a concern than for shared views. The indexes of server private views are not<br />
maintained by the UPDATE task; they are only refreshed when the user actually uses<br />
them. However, depending on the complexity of the view design, the number of<br />
documents in the view, and the amount of turnover, that can still be a fair amount of work<br />
for the server to execute on demand.<br />
In terms of security exposure, we don't want to explain in detail, to avoid giving people<br />
instructions how to exploit this. Instead we will just state the principal: in applications that<br />
use Readers fields for document-level security, do not allow end users either of these<br />
215 of 217
accesses.<br />
NOTE: Any user with a Notes client and Reader access to a database can also create<br />
"desktop private" views stored on their workstation. This may also make extra work for<br />
the server when the views are used, since the client will request summary information<br />
about all recently modified documents. However, it's not as much work for the server, and<br />
there's no setting to affect this anyway, so don't worry about it.<br />
6.7. Graphics<br />
Graphics on your application's pages, when done incorrectly, can really affect the perceived<br />
performance of your application by significantly increasing bandwidth requirements. Here are some<br />
of the best practices for dealing with graphics on your web pages.<br />
6.7.1 Image types<br />
When working with images, you should limit yourself to the three major file types: PNG,<br />
JPEG, and GIF. You should not use older formats such as BMP that do not compress<br />
very well.<br />
GIF<br />
GIF stands for Graphics Interchange Format, and is the only format that allows for<br />
animated images. It allows an image to reference a palette of up to 256 distinct colors.<br />
Because of the color limitation, the GIF format is not the best choice for color<br />
photographs. This format is best used for graphics, logos, or other images with solid<br />
colors.<br />
JPEG<br />
JPEG stands for Joint Photographic Experts Group (the group that created the standard).<br />
This type is most often used for photographs, which is why the type is used by most<br />
digital cameras. It is best suited for images that have smooth variation of tone and color,<br />
which is why it is best for photographs.<br />
PNG<br />
PNG stands for Portable Network Graphics, and was developed as a replacement for the<br />
GIF format. However, PNG does not support multiple images (animation). It supports a<br />
wider array of colors than the GIF format does. Many times, an original GIF image stores<br />
in a smaller file when stored as a PNG image. If bandwidth is a concern, you should use<br />
PNG instead of GIF for your logos, graphics, or other non-photographic images.<br />
6.7.2 Caching<br />
There are two types of caching when it comes to images – caching by the <strong>Domino</strong> server,<br />
and caching by the local browser or client. If a URL used to locate an image remains<br />
constant, it can be cached by the local browser or client and used on subsequent page<br />
requests by the same browser.<br />
216 of 217
To take advantage of <strong>Domino</strong> server image caching, use Image Resources for your<br />
images. You can reference the Image Resource in your XPage designs. These images<br />
are cached by the <strong>Domino</strong> server and improve the performance for subsequent<br />
renderings of the page by different users.<br />
6.7.3 Scaling<br />
If you want to have an image and a thumbnail of the image, use two distinct images<br />
instead of trying to scale on the browser. There are no-charge Internet sites where you<br />
can convert an image to a thumbnail. The thumbnail does not need to have the same<br />
fidelity as the original image, and can therefore be a far smaller file size. If you scale on<br />
the browser, you are affecting the performance of your application in two ways:<br />
<br />
<br />
The full image has to be sent to the browser, increasing bandwidth over the<br />
thumbnail.<br />
The browser has to do the work of scaling the image down to the right size, which<br />
takes CPU cycles on the user's computer to complete.<br />
Using two images does not take advantage of caching on the browser, but the<br />
disadvantages of increasing the bandwidth and the browser scaling more than offsets the<br />
caching advantage (which is not an advantage when an individual browser first visits a<br />
page).<br />
6.7.4 Compression<br />
There are two types of image compression: "lossy” and “lossless". When an image is<br />
compressed, if done using a "lossless" compression, all the data in the original image is<br />
maintained. In a "lossy" compression, some of the data is removed from the original file<br />
to achieve a smaller file size. Depending on the image, the changes to the image may be<br />
imperceptible. Photographs generally benefit the most from “lossy” compression. There<br />
are many web sites on the Internet that compress images that you upload to their server.<br />
If you are using graphics in your application, see if you (or a co-worker) notice the<br />
difference between the original and the compressed image. If the differences are difficult<br />
to distinguish, then you should use the compressed image with the reduced file size in<br />
your application – the reduced network traffic will improve the performance of your<br />
application.<br />
217 of 217