This document outlines an agenda for a talk titled "AD505 DevBlast – 30 LotusScript Tips". The talk aims to provide 30 LotusScript tips organized into three sections: Nursery Slopes (10 fundamental tips), Everyday Tips (10 less well known tips), and Advanced Tips (10 tips to provoke thought). The introduction provides background on the speaker and explains the goal of sharing 30 tips using the "Lazy Programmer" methodology of breaking problems into manageable pieces.
This document outlines 30 LotusScript development tips that are divided into 3 sections: Nursery Slopes (10 fundamental tips), Everyday Tips (10 less well known tips), and Advanced Tips (10 tips to provoke thought). The tips are presented by Bill Buchan, an experienced LotusScript consultant, with the goal of sharing lessons learned and pushing developers outside their comfort zone.
- Legacy Perl code is code that uses outdated practices, has no tests or documentation, and is difficult to understand and modify. It often results from organic growth over many years and developers.
- Unit testing legacy code provides safety during refactoring, speeds up development by replacing debugging, and creates regression tests. However, the code's dependencies make it difficult to isolate and test.
- Techniques like dependency injection, sprouting, monkey patching, and temporary object reblessing can help break dependencies and make legacy code more testable. Instrumentation with profilers also aids understanding the code.
Save time by applying clean code principlesEdorian
This document discusses applying clean code principles to save time. It motivates clean code by noting that developers spend most of their time reading and understanding code. It recommends techniques like testing, coding standards, dependency injection and small focused classes to make code easier to read and maintain. Examples show how naming conventions, short functions, avoiding comments and value objects can clarify code's intent and purpose.
The document outlines coding conventions and best practices for C# programming, including recommendations for naming conventions, indentation, spacing, commenting, exception handling, and other programming practices. It was compiled from various sources including Microsoft guidelines to help improve code readability and maintainability. Adhering to consistent coding standards can reduce software maintenance costs by making code easier for others to understand and maintain.
The document discusses various coding best practices and conventions for writing good quality code, including naming conventions, formatting guidelines, and general programming practices. Some key points covered include using descriptive names, consistent indentation and spacing, single responsibility per method, error handling, and separating concerns between layers.
This document provides 30 tips for optimizing LotusScript development, organized into sections on theory, practice, and advanced techniques, with the theoretical tips focusing on fundamentals, the practical tips on common best practices, and the advanced tips intended to provoke new ideas.
This document provides a summary of a presentation on web services in Domino. The presentation covers using Domino to provide web services using LotusScript, and using Notes to consume web services. It includes an agenda, introductions, overviews of web services and architectures, examples of creating and consuming a sample contacts web service in Domino, differences between ND7 and ND8, and questions.
The View object orientated programming in LotuscriptBill Buchan
This document provides an overview of object-oriented programming in LotusScript. It begins by explaining the benefits of object-oriented programming such as reduced code volume, increased code reuse, and simplified complex applications. It then covers object-oriented basics in LotusScript like defining classes, creating class instances, and extending classes. The document demonstrates these concepts through examples and provides tips for best practices. It also discusses considerations for designing large object-oriented projects in LotusScript.
This document outlines 30 LotusScript development tips that are divided into 3 sections: Nursery Slopes (10 fundamental tips), Everyday Tips (10 less well known tips), and Advanced Tips (10 tips to provoke thought). The tips are presented by Bill Buchan, an experienced LotusScript consultant, with the goal of sharing lessons learned and pushing developers outside their comfort zone.
- Legacy Perl code is code that uses outdated practices, has no tests or documentation, and is difficult to understand and modify. It often results from organic growth over many years and developers.
- Unit testing legacy code provides safety during refactoring, speeds up development by replacing debugging, and creates regression tests. However, the code's dependencies make it difficult to isolate and test.
- Techniques like dependency injection, sprouting, monkey patching, and temporary object reblessing can help break dependencies and make legacy code more testable. Instrumentation with profilers also aids understanding the code.
Save time by applying clean code principlesEdorian
This document discusses applying clean code principles to save time. It motivates clean code by noting that developers spend most of their time reading and understanding code. It recommends techniques like testing, coding standards, dependency injection and small focused classes to make code easier to read and maintain. Examples show how naming conventions, short functions, avoiding comments and value objects can clarify code's intent and purpose.
The document outlines coding conventions and best practices for C# programming, including recommendations for naming conventions, indentation, spacing, commenting, exception handling, and other programming practices. It was compiled from various sources including Microsoft guidelines to help improve code readability and maintainability. Adhering to consistent coding standards can reduce software maintenance costs by making code easier for others to understand and maintain.
The document discusses various coding best practices and conventions for writing good quality code, including naming conventions, formatting guidelines, and general programming practices. Some key points covered include using descriptive names, consistent indentation and spacing, single responsibility per method, error handling, and separating concerns between layers.
This document provides 30 tips for optimizing LotusScript development, organized into sections on theory, practice, and advanced techniques, with the theoretical tips focusing on fundamentals, the practical tips on common best practices, and the advanced tips intended to provoke new ideas.
This document provides a summary of a presentation on web services in Domino. The presentation covers using Domino to provide web services using LotusScript, and using Notes to consume web services. It includes an agenda, introductions, overviews of web services and architectures, examples of creating and consuming a sample contacts web service in Domino, differences between ND7 and ND8, and questions.
The View object orientated programming in LotuscriptBill Buchan
This document provides an overview of object-oriented programming in LotusScript. It begins by explaining the benefits of object-oriented programming such as reduced code volume, increased code reuse, and simplified complex applications. It then covers object-oriented basics in LotusScript like defining classes, creating class instances, and extending classes. The document demonstrates these concepts through examples and provides tips for best practices. It also discusses considerations for designing large object-oriented projects in LotusScript.
This document provides an overview and summary of the key topics to be covered in a presentation on comparing Microsoft SharePoint and IBM Lotus Domino. The presentation will be given by Justin Lee, a Microsoft SharePoint MVP, and Stephan Wissel from IBM Singapore. The agenda includes discussing SharePoint APIs, reading and writing data to and from SharePoint, integrating SharePoint into XPages applications, and migrating from SharePoint back to Domino. Biographies of the presenters are also provided.
jmp206 - Lotus Domino Web Services JumpstartBill Buchan
This document provides an overview of a web services bootcamp session presented by Bill Buchan. The agenda covers using Domino to provide web services using LotusScript, Java servlets, and agents, as well as using Notes to consume web services using LotusScript, COM, and Stubby. The document introduces web services concepts and architectures. It discusses using LotusScript in Domino 7 and 8 to easily create web services and profile performance. It also covers more complex options like Java servlets which provide persistence but require more work. The session includes demonstrations of creating and testing a sample web service using a contacts database.
The document provides an agenda and overview for a web services bootcamp presentation. The agenda includes an introduction, overview of web services, using Domino to provide web services with LotusScript, and using Notes to consume web services with LotusScript, COM, and Stubby in Notes 7. The overview explains what web services are and the typical architecture involving a server and client. It also discusses the web services protocol and designing sample applications to demonstrate the techniques.
The document contains the 11 commandments for administrators and developers working with Lotus Notes and Domino. It discusses important principles for each role, such as change control, security practices, writing maintainable code, understanding versions, and monitoring systems. The speakers provide guidance and warnings about common problems that can occur when these best practices are not followed.
Lotusphere 2008 - Jumpstart 206 - Web Services BootcampBill Buchan
Learn all there is to know about web services -- Lotuscript-based, Java-based, and RESTful ones. Come see how to construct web services using nothing more than an IBM Lotus Notes agent, and parse XML and debug SOAP calls. Learn the pitfalls, the traps, the SOAP encoding methods! Learn the shortcuts as well as the benefits! Not working with web services yet ? Find out how these industry standard techniques will allow you to get data in and out of IBM Lotus Domino from all your other corporate applications. Web services is the ''new black''. Be fashionable!
The presentation can be downloaded from here, the example database can be downloaded from here, and the source code for the Java Web Service Servlet can be downloaded from here
Note:
I really wasnt happy with the code to make an agent act as a web service, so I've removed it.
The Servlet source code is a ZIP file containing a snapshot of my eclipse v3.3.2 project. You also need to add:
Java v1.3.1 as a compilation environment for Domino v6.5
Notes.Jar
LotusXML.jar
No support can be given for any of this code. Basically, you need to know what your doing java-wise to get any benefit from this..
Here is a simple example of calling the Notes C API from LotusScript:
Declare Function LNPUBLIC NotesInit Lib "nnotes" () As Integer
Sub Initialize
Dim status As Integer
status = NotesInit()
If status <> 0 Then
Print "Notes initialization failed with error: " + CStr(status)
Else
Print "Notes initialized successfully."
End If
End Sub
This declares and calls the simple NotesInit() function to initialize the Notes environment. It checks the return status and prints a message.
Powered by Den nächste Schritt zum Erfolg : Domino&Notes 8Bundled-KnowHow
Report di sintesi del Report relativo a Web e Social Media Monitoring condotto da Extreme in collaborazione con Fondazione Sistema Toscana - Maggio 2013
Marykirk raft race presentation night 2014Bill Buchan
This document summarizes the 2014 Marykirk Raft Race event which raises money for charity. Some key details:
- The event involves teams racing homemade rafts down a river while dressed in costumes, followed by further activities in a park. It has been held annually since the mid-1990s.
- In 2014 there were 13 participating raft teams who raced to win trophies for fastest time and best costumes. The top three finishers were announced.
- Over £7,000 was raised and distributed between several local charities, including the Children's Hospice Association Scotland and a local school.
- Volunteers are thanked for their help each year and attendees are encouraged to join the committee
1. The document describes a workshop on developing BlackBerry applications that access Domino applications via web services.
2. It provides an overview of architectures for connecting BlackBerry and Domino, teaches how to enable a Domino application as a web service, and how to use the BlackBerry MDS Studio to build a basic BlackBerry app to retrieve and display data from the web service.
3. The workshop takes attendees through lessons building their first app and then a more complex one, with the goal of teaching how to enable mobile access to Domino data on BlackBerry devices.
This document provides tips for developing contacts and stories for enterprise journalism. It recommends reading news with an eye for potential contact leads. Reporters should include blogs, forums, hobbies, clubs and community activities to meet new people and learn about local stories. The document advises finding an important specialty or "beat" and becoming an expert on certain types of stories. Reporters should work to develop mutual trust with contacts and ask what people think is wrong with television news to find potential stories.
REST services and IBM Domino/XWork - DanNotes 19-20. november 2014John Dalsgaard
Loose coupling of systems is key to future development! Why? Because it will allow us to change the "components" as we go along instead of creating monster big systems that are tied together using all sorts of different technologies. Webservices have been a way to obtain this over the last decade. More recently a special variant has become very popular, namely the JSON based REST service.
Imagine you could extend your data out to the world outside your Domino environment? - in an easy way....! And imagine those data could easily be incorporated into other systems via standardized interfaces... Could that extend the value of your current systems further? Could this be a way to use new technologies to modernize your users' experience of working with your systems?
Come and take away knowledge about how to open your Domino/XWork based systems up to the world outside using JSON based REST services. They are going to be key to future development in Domino/XWork - whether you want to use data in browser solutions (e.g. based on angular.js or ExtJS) or native mobile apps (built in whatever technology is best).
This document provides an overview of 30 tips for optimizing LotusScript development. It begins with introductions and outlines, then groups the tips into three sections: Theory, Practice, and Advanced. The Theory section covers 10 fundamental tips regarding best practices like using Option Declare, version control, application lifecycles, code structure, testing, and error handling. The Practice section presents 10 tips that should be implemented regularly, such as defensive coding, extending arrays, logging, and using NotesDateTime. The Advanced section introduces more complex topics like custom classes and binding. The goal is to help LotusScript developers improve code quality, maintainability, and performance.
Dev buchan everything you need to know about agent designBill Buchan
This document provides an overview of using the Lotus Notes C API security interfaces from LotusScript. It discusses two specific C API functions - REGGetIDInfo and SECKFMChangePassword. REGGetIDInfo allows you to examine an existing ID file and retrieve information such as whether it is hierarchical or a certifier. SECKFMChangePassword is used to change a password on an ID file. The document includes LotusScript code examples for calling these functions and retrieving the returned values. It defines several constants needed to specify the type of information to retrieve from the ID file.
This document outlines an agenda for a talk on 30 LotusScript tips. It begins with an introduction that explains the structure of the talk and why it will cover 30 tips. The agenda is then broken into sections on fundamental tips ("Nursery Slopes"), less well known everyday tips, and more advanced tips to provoke thought. Each section provides 10 tips on topics like using Option Declare, templates and versions, error handling, classes, and performance coding. The document aims to share a variety of LotusScript best practices and techniques.
The document outlines 30 LotusScript tips that are divided into 3 sections - Nursery Slopes (10 fundamental tips), Everyday Tips (10 less well known tips), and Advanced Tips (10 tips to provoke thought) with the goal of helping LotusScript developers improve their skills and best practices.
BP206 - Let's Give Your LotusScript a Tune-Up Craig Schumann
The document provides tips for improving LotusScript performance by identifying and addressing bottlenecks. It discusses identifying where performance issues occur, tools for measuring performance such as using the Now function and GetThreadInfo, and avoiding common pitfalls like overuse of GetNthDocument and unnecessary code. The document emphasizes the importance of measuring performance empirically before optimizing code.
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...Bill Buchan
Co-presented with Jens Augustini
Object Oriented Programming (OOP) may drastically reduce your coding time in projects that reach a higher degree of complexity, as it brings re-usable and consistent logic in the form of your own objects to your fingertips. This session will show how to create and use your own classes and how they can relate to the LotusScript Object Model. If you are familiar with LotusScript but don't know how to create your own classes, this session is for you!
Visual Basic 6 allows developers to design graphical user interfaces and connect to databases. It uses an event-driven programming model where code executes in response to user and system events like button clicks. The document discusses connecting a VB application to a Microsoft Access database using ActiveX Data Objects (ADO). Developers add an ADO Data Control to the form, specify the database file path in its connection string, and select the table as the record source. Common ADO commands allow navigating and updating the recordset. Visual Basic provides a visual interface for building Windows applications and integrating with databases through controls like ADO.
Visual Basic 6 allows developers to design graphical user interfaces and connect to databases. It uses an event-driven programming model where code executes in response to user and system events like button clicks. The document discusses connecting a VB application to a Microsoft Access database using ActiveX Data Objects (ADO). Developers add an ADO Data Control to the form, specify the database file path in its connection string, and select the table as the record source. Common ADO commands allow navigating and updating the recordset. Visual Basic provides a visual interface for building Windows applications and integrating with databases through ADO.
មេរៀនៈ Data Structure and Algorithm in C/C++Ngeam Soly
This document provides an introduction to a lecture on data structures and algorithms. It discusses the lecturer's contact information and expectations for reading ahead of lectures. It then covers topics that will be discussed in the course, including programs and programming, introduction to programming, crafting programs effectively, what makes a good program, and why data structures and algorithms are important subjects. The document provides an overview of what will be covered in the course.
The document provides a 12 step guide to writing efficient and maintainable LotusScript code. The steps include how to code with a focus on maintenance, testing early and often, planning before coding with the "measure twice, cut once" approach, using defensive coding practices, leveraging built-in data types like NotesDateTime instead of strings, and using functions like Evaluate and GetThreadInfo to get runtime information. Logging is also recommended for applications with scheduled agents or a diverse user base. The overall emphasis is on writing code that is well-structured, tested, and optimized for long-term maintenance and support.
This document provides an overview and summary of the key topics to be covered in a presentation on comparing Microsoft SharePoint and IBM Lotus Domino. The presentation will be given by Justin Lee, a Microsoft SharePoint MVP, and Stephan Wissel from IBM Singapore. The agenda includes discussing SharePoint APIs, reading and writing data to and from SharePoint, integrating SharePoint into XPages applications, and migrating from SharePoint back to Domino. Biographies of the presenters are also provided.
jmp206 - Lotus Domino Web Services JumpstartBill Buchan
This document provides an overview of a web services bootcamp session presented by Bill Buchan. The agenda covers using Domino to provide web services using LotusScript, Java servlets, and agents, as well as using Notes to consume web services using LotusScript, COM, and Stubby. The document introduces web services concepts and architectures. It discusses using LotusScript in Domino 7 and 8 to easily create web services and profile performance. It also covers more complex options like Java servlets which provide persistence but require more work. The session includes demonstrations of creating and testing a sample web service using a contacts database.
The document provides an agenda and overview for a web services bootcamp presentation. The agenda includes an introduction, overview of web services, using Domino to provide web services with LotusScript, and using Notes to consume web services with LotusScript, COM, and Stubby in Notes 7. The overview explains what web services are and the typical architecture involving a server and client. It also discusses the web services protocol and designing sample applications to demonstrate the techniques.
The document contains the 11 commandments for administrators and developers working with Lotus Notes and Domino. It discusses important principles for each role, such as change control, security practices, writing maintainable code, understanding versions, and monitoring systems. The speakers provide guidance and warnings about common problems that can occur when these best practices are not followed.
Lotusphere 2008 - Jumpstart 206 - Web Services BootcampBill Buchan
Learn all there is to know about web services -- Lotuscript-based, Java-based, and RESTful ones. Come see how to construct web services using nothing more than an IBM Lotus Notes agent, and parse XML and debug SOAP calls. Learn the pitfalls, the traps, the SOAP encoding methods! Learn the shortcuts as well as the benefits! Not working with web services yet ? Find out how these industry standard techniques will allow you to get data in and out of IBM Lotus Domino from all your other corporate applications. Web services is the ''new black''. Be fashionable!
The presentation can be downloaded from here, the example database can be downloaded from here, and the source code for the Java Web Service Servlet can be downloaded from here
Note:
I really wasnt happy with the code to make an agent act as a web service, so I've removed it.
The Servlet source code is a ZIP file containing a snapshot of my eclipse v3.3.2 project. You also need to add:
Java v1.3.1 as a compilation environment for Domino v6.5
Notes.Jar
LotusXML.jar
No support can be given for any of this code. Basically, you need to know what your doing java-wise to get any benefit from this..
Here is a simple example of calling the Notes C API from LotusScript:
Declare Function LNPUBLIC NotesInit Lib "nnotes" () As Integer
Sub Initialize
Dim status As Integer
status = NotesInit()
If status <> 0 Then
Print "Notes initialization failed with error: " + CStr(status)
Else
Print "Notes initialized successfully."
End If
End Sub
This declares and calls the simple NotesInit() function to initialize the Notes environment. It checks the return status and prints a message.
Powered by Den nächste Schritt zum Erfolg : Domino&Notes 8Bundled-KnowHow
Report di sintesi del Report relativo a Web e Social Media Monitoring condotto da Extreme in collaborazione con Fondazione Sistema Toscana - Maggio 2013
Marykirk raft race presentation night 2014Bill Buchan
This document summarizes the 2014 Marykirk Raft Race event which raises money for charity. Some key details:
- The event involves teams racing homemade rafts down a river while dressed in costumes, followed by further activities in a park. It has been held annually since the mid-1990s.
- In 2014 there were 13 participating raft teams who raced to win trophies for fastest time and best costumes. The top three finishers were announced.
- Over £7,000 was raised and distributed between several local charities, including the Children's Hospice Association Scotland and a local school.
- Volunteers are thanked for their help each year and attendees are encouraged to join the committee
1. The document describes a workshop on developing BlackBerry applications that access Domino applications via web services.
2. It provides an overview of architectures for connecting BlackBerry and Domino, teaches how to enable a Domino application as a web service, and how to use the BlackBerry MDS Studio to build a basic BlackBerry app to retrieve and display data from the web service.
3. The workshop takes attendees through lessons building their first app and then a more complex one, with the goal of teaching how to enable mobile access to Domino data on BlackBerry devices.
This document provides tips for developing contacts and stories for enterprise journalism. It recommends reading news with an eye for potential contact leads. Reporters should include blogs, forums, hobbies, clubs and community activities to meet new people and learn about local stories. The document advises finding an important specialty or "beat" and becoming an expert on certain types of stories. Reporters should work to develop mutual trust with contacts and ask what people think is wrong with television news to find potential stories.
REST services and IBM Domino/XWork - DanNotes 19-20. november 2014John Dalsgaard
Loose coupling of systems is key to future development! Why? Because it will allow us to change the "components" as we go along instead of creating monster big systems that are tied together using all sorts of different technologies. Webservices have been a way to obtain this over the last decade. More recently a special variant has become very popular, namely the JSON based REST service.
Imagine you could extend your data out to the world outside your Domino environment? - in an easy way....! And imagine those data could easily be incorporated into other systems via standardized interfaces... Could that extend the value of your current systems further? Could this be a way to use new technologies to modernize your users' experience of working with your systems?
Come and take away knowledge about how to open your Domino/XWork based systems up to the world outside using JSON based REST services. They are going to be key to future development in Domino/XWork - whether you want to use data in browser solutions (e.g. based on angular.js or ExtJS) or native mobile apps (built in whatever technology is best).
This document provides an overview of 30 tips for optimizing LotusScript development. It begins with introductions and outlines, then groups the tips into three sections: Theory, Practice, and Advanced. The Theory section covers 10 fundamental tips regarding best practices like using Option Declare, version control, application lifecycles, code structure, testing, and error handling. The Practice section presents 10 tips that should be implemented regularly, such as defensive coding, extending arrays, logging, and using NotesDateTime. The Advanced section introduces more complex topics like custom classes and binding. The goal is to help LotusScript developers improve code quality, maintainability, and performance.
Dev buchan everything you need to know about agent designBill Buchan
This document provides an overview of using the Lotus Notes C API security interfaces from LotusScript. It discusses two specific C API functions - REGGetIDInfo and SECKFMChangePassword. REGGetIDInfo allows you to examine an existing ID file and retrieve information such as whether it is hierarchical or a certifier. SECKFMChangePassword is used to change a password on an ID file. The document includes LotusScript code examples for calling these functions and retrieving the returned values. It defines several constants needed to specify the type of information to retrieve from the ID file.
This document outlines an agenda for a talk on 30 LotusScript tips. It begins with an introduction that explains the structure of the talk and why it will cover 30 tips. The agenda is then broken into sections on fundamental tips ("Nursery Slopes"), less well known everyday tips, and more advanced tips to provoke thought. Each section provides 10 tips on topics like using Option Declare, templates and versions, error handling, classes, and performance coding. The document aims to share a variety of LotusScript best practices and techniques.
The document outlines 30 LotusScript tips that are divided into 3 sections - Nursery Slopes (10 fundamental tips), Everyday Tips (10 less well known tips), and Advanced Tips (10 tips to provoke thought) with the goal of helping LotusScript developers improve their skills and best practices.
BP206 - Let's Give Your LotusScript a Tune-Up Craig Schumann
The document provides tips for improving LotusScript performance by identifying and addressing bottlenecks. It discusses identifying where performance issues occur, tools for measuring performance such as using the Now function and GetThreadInfo, and avoiding common pitfalls like overuse of GetNthDocument and unnecessary code. The document emphasizes the importance of measuring performance empirically before optimizing code.
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...Bill Buchan
Co-presented with Jens Augustini
Object Oriented Programming (OOP) may drastically reduce your coding time in projects that reach a higher degree of complexity, as it brings re-usable and consistent logic in the form of your own objects to your fingertips. This session will show how to create and use your own classes and how they can relate to the LotusScript Object Model. If you are familiar with LotusScript but don't know how to create your own classes, this session is for you!
Visual Basic 6 allows developers to design graphical user interfaces and connect to databases. It uses an event-driven programming model where code executes in response to user and system events like button clicks. The document discusses connecting a VB application to a Microsoft Access database using ActiveX Data Objects (ADO). Developers add an ADO Data Control to the form, specify the database file path in its connection string, and select the table as the record source. Common ADO commands allow navigating and updating the recordset. Visual Basic provides a visual interface for building Windows applications and integrating with databases through controls like ADO.
Visual Basic 6 allows developers to design graphical user interfaces and connect to databases. It uses an event-driven programming model where code executes in response to user and system events like button clicks. The document discusses connecting a VB application to a Microsoft Access database using ActiveX Data Objects (ADO). Developers add an ADO Data Control to the form, specify the database file path in its connection string, and select the table as the record source. Common ADO commands allow navigating and updating the recordset. Visual Basic provides a visual interface for building Windows applications and integrating with databases through ADO.
មេរៀនៈ Data Structure and Algorithm in C/C++Ngeam Soly
This document provides an introduction to a lecture on data structures and algorithms. It discusses the lecturer's contact information and expectations for reading ahead of lectures. It then covers topics that will be discussed in the course, including programs and programming, introduction to programming, crafting programs effectively, what makes a good program, and why data structures and algorithms are important subjects. The document provides an overview of what will be covered in the course.
The document provides a 12 step guide to writing efficient and maintainable LotusScript code. The steps include how to code with a focus on maintenance, testing early and often, planning before coding with the "measure twice, cut once" approach, using defensive coding practices, leveraging built-in data types like NotesDateTime instead of strings, and using functions like Evaluate and GetThreadInfo to get runtime information. Logging is also recommended for applications with scheduled agents or a diverse user base. The overall emphasis is on writing code that is well-structured, tested, and optimized for long-term maintenance and support.
Designing A Project Using Java ProgrammingKaty Allen
The document discusses the Connector class in the NS simulator. The Connector class is a subclass of NsObject and is the superclass for basic network components that handle packets, such as hubs and links. Connector objects have a single output queue, while Classifier objects can have multiple output queues. When packets traverse connections in the NS simulator, various follow objects are embedded in the connections to log events such as enqueue, dequeue, drop, and receive to trace packet flow.
The document discusses the pros and cons of using open source software in projects. It notes that open source code comes with various licenses like GPL, BSD, and MIT that differ in how they can be used. While open source lacks perceived accountability, it actually has governance structures. The document aims to provide context on open source licensing and use within the scope of incorporating external code into a project. It addresses common concerns about open source like licensing complexity but clarifies the intent is to protect author rights, not hinder code use.
Architecting a Large Software Project - Lessons LearnedJoão Pedro Martins
In large projects, the Software Architect role includes both the client communication and requirements management, and the solution design itself, making sure technical quality is garanteed. This presentation describes the lessons learned with a highly successful project that took 3 years of development until its production phase, in technical, functional, and architeture aspects.
Presented at the 50th meeting of the Netponto Community in Lisboa, Portugal.
The sole purpose of sharing these slides are to educate the beginners of IT and Computer Science/Engineering. Credits should go to the referred material and also CICRA campus, Colombo 4, Sri Lanka where I taught these in 2017.
It's a talk about how to write understandable code from understanding human brain at Taipei.py [1] and PyCon HK 2015 [2].
[1]: http://www.meetup.com/Taipei-py/events/222174472/
[2]: http://2015.pycon.hk/
The PVS-Studio team is now actively developing a static analyzer for C# code. The first version is expected by the end of 2015. And for now my task is to write a few articles to attract C# programmers' attention to our tool in advance. I've got an updated installer today, so we can now install PVS-Studio with C#-support enabled and even analyze some source code. Without further hesitation, I decided to scan whichever program I had at hand. This happened to be the Umbraco project. Of course we can't expect too much of the current version of the analyzer, but its functionality has been enough to allow me to write this small article.
Top Tips Every Notes Developer Needs To KnowKathy Brown
This document provides an overview of important topics for new IBM Lotus Domino developers to know. It covers coding best practices, application architecture, languages and features, learning resources, user interface design, and administrative concepts. Specific areas discussed include option declare, error handling, reusable code, testing, the LotusScript debugger, formulas, DXL, layers, help resources, prototyping, documentation, change control, security, readers fields, performance tuning, and basic administration. The presentation encourages asking questions and emphasizes the importance of these foundational development practices.
This document provides an agenda and overview for a training session on advanced object-oriented programming techniques for LotusScript. The session will cover why OOP is useful, basic OOP concepts, and then more advanced techniques like inheritance, polymorphism, singleton patterns, and strategies for organizing large codebases. The goal is to help developers improve code quality, reuse, efficiency and robustness by leveraging OOP principles in LotusScript applications.
Visual Basic 6 allows users to design graphical user interfaces and develop Windows applications. It uses an event-driven programming model where code executes in response to events like user input. The language provides features for creating windows, accessing databases, and using ActiveX technologies. Visual Basic compiles and interprets code as it is written to catch errors early in development. Key concepts include windows, events, and messages which allow applications to respond to user input and system events.
The document provides an overview of Visual Basic 6 and its key concepts. It discusses Visual Basic as an event-driven programming language used to build graphical user interfaces. It explains some of Visual Basic's main features like data access, ActiveX technologies, and internet capabilities. It also covers important Visual Basic concepts like windows, events, event-driven programming, interpreting and compiling code, and the Visual Basic integrated development environment.
1. The document provides an introduction to the Node.js course, covering topics like JavaScript basics, Node.js fundamentals, Express.js, debugging, and more.
2. Key concepts discussed include how the Node.js runtime works, using core modules, asynchronous programming with callbacks and promises, and the module system.
3. Express.js is introduced as a popular web framework that handles requests and responses, routing, and other complex server tasks so developers can focus on business logic. Debugging tools are also covered.
Similar to Lotusphere 2007 AD505 DevBlast 30 LotusScript Tips (20)
This document provides an overview of wireless internet service providers (WISPs) through a presentation by Bill Buchan, who has 9 years of experience running a WISP. It discusses the technology, networking, and management of WISPs. The presentation walks through solving a rural broadband issue using line-of-sight wireless connections, choosing appropriate antenna types and equipment, and provides an example network design to deliver wireless internet to customers. It also covers potential issues that can arise with WISPs.
This document provides an overview of wireless internet service providers (WISPs) and how they construct their networks. It discusses how WISPs use inexpensive commercial off-the-shelf equipment like Ubiquiti devices along with frequencies like 5.5GHz to connect locations within line of sight and provide internet access to rural areas without wired infrastructure. The document also outlines the typical network architecture involving routers, switches, and wireless backhaul to residential customers.
Bill Buchan presented on worst practices in wireless internet service provision to underline best practices. Some examples included: a wireless site container that tipped over during a storm due to incorrect wind loading calculations; overloading an inverter powering multiple radios and cameras; a cable that was damaged by rust allowing water ingress; an antenna mounted upside down allowing water to fill it; fiber cables being chewed by mice; and safety issues like working at heights without harnesses or falling tools. The presentation emphasized planning, maintenance, equipment siting and securing cables and gear to avoid outages and hazards.
1. Scheduled agents should be monitored to ensure they are running successfully on servers. A central log database can be used to store status documents from agents and alert if reports are overdue.
2. Logging is important for scheduled agents but the NotesLog model can result in large log files. It is better to develop a "ticker-tape" style log facility that stores each log entry in a small document.
3. When designing scheduled agents, consider how to handle processing large amounts of data within the limited runtime. The agent may need to run multiple times and checkpoint processing to avoid timeouts.
LSX allows LotusScript code to connect to and exchange data with external databases. It provides several methods with different performance, platform independence, and whether it requires a native client. The presentation explores using LSX to read and write data between a Notes database and an Access or Oracle database. Code examples demonstrate connecting via ODBC, retrieving records from SQL and writing them to Notes documents, and inserting Notes document fields into SQL tables. Overall LSX provides a way to interface Notes with other databases for bulk data transfer applications.
This document provides a summary of leveraging the Notes C API in LotusScript. It discusses calling both simple and complex Notes C API functions from LotusScript code. Platform differences are highlighted when calling the C API directly. Custom classes are demonstrated as a way to hide platform differences and properly manage Notes C API handles. Examples are provided of calling simple API functions as well as handling complex sequences involving database handles.
This document discusses calling the Notes C API from LotusScript. It describes the LotusScript eXtension (LSX) toolkit, which allows extending LotusScript with custom C code by building platform-specific libraries. It also covers differences between platforms when calling the Notes C API directly from LotusScript, such as data types and library file names. As an example, it demonstrates calling the simple NSFGetServerLatency() API function from LotusScript to get network latency between servers.
This document summarizes a presentation on leveraging object-oriented programming techniques in LotusScript. It introduces object-oriented concepts like classes, objects, and encapsulation. It then walks through building an application to monitor news sites for company mentions using a class to represent each site and a nested class to represent individual news items. The presentation demonstrates encapsulating the news item class within the site class and using inheritance by extending all classes from a base class. It shows how to make the application more robust by adding logging through the base class.
Bill Buchan will present on consuming and providing web services using Domino. The presentation will cover using Domino to provide SOAP-based web services, using Notes to consume web services, using XPages to provide REST-based web services, and consuming web services from C#. The goal is to help Domino developers get started with or enhance the web services capabilities in their environments.
The document provides a 12 step guide to writing effective LotusScript code. The steps include how to code for maintenance, testing code often and completely, spending time planning before coding, using defensive coding practices, leveraging built-in data types like Lists and NotesDateTime, and using logging and error handling techniques. Following the guide is intended to help produce code that is easier to maintain, has fewer bugs, and higher performance.
Everything you ever wanted to know about lotus scriptBill Buchan
Bill Buchan, a CEO and consultant with experience in LotusScript since 1995, gave a presentation on LotusScript. He discussed that LotusScript is an older language that is no longer a priority for development. However, it is still used to maintain many existing Domino applications. The presentation covered LotusScript basics like variables, classes, lists and the NotesSession object. It also discussed advanced topics such as calling C APIs, using the Execute statement, and creating web services with LotusScript.
This document discusses two methods for implementing single sign-on (SSO) between Active Directory and Domino: the Websphere plugin method and the SPNEGO method. The Websphere plugin method uses IIS as a front-end and relies on Kerberos tickets to pass authentication to Domino. The SPNEGO method implemented directly in Domino 8.5.1 and above also relies on Kerberos but does not require IIS. The document provides high-level overviews of how each method works and their relative pros and cons.
The presentation "Development for Administrators" was presented at AdminCamp 2006 in Germany, and a revised version presented at SoftSphere in Frankfurt in October 2007. This presentation intends to show Administrators:
Introduce proper development, UAT and production environments
show some basic @Formula language agents
Show some basic LotusScript functions
The document appears to be a presentation about worst practices in IT systems. It discusses several "case studies" or examples of things going wrong. The first case discusses a large organization where users stopped receiving new email due to a flag being incorrectly set in the mail template. The second case discusses archiving issues at another large organization where the archive server was down for weeks without notice. The third case discusses a router crashing multiple times due to an untested agent created in the mail template.
The document describes several "worst practice" case studies involving mistakes made with IBM Notes/Domino environments. Case 1 involved an emergency shutdown of a data center that crashed the SAN due to improper cooling system controls. Case 2 involved a user deleting over 1,500 documents by improperly replicating between servers. Case 3 saw a developer enable out-of-office messages for all 18,000 users by mistake. The remaining cases involve other issues like access control changes locking out users and assuming environment changes would be isolated. Overall the document aims to discuss lessons learned from real mistakes that compromised production environments.
Lotusphere 2007 BP301 Advanced Object Oriented Programming for LotusScriptBill Buchan
This session starts where the introductory Object Oriented Programming for LotusScript session stops. We'll show advanced encapsulation and inheritance, and demonstrates best practice code reuse with Object Oriented Programming techniques.You'll leave with a fully functional IBM Lotus Notes application containing enterprise features such as error trapping, log levels, code reuse and a far greater understanding of Object Oriented Programming methodology within LotusScript.
Identity management delegation and automationBill Buchan
The presentation "Identity Management Delegation & Automation" was presented at Lotusphere Comes to You - hosted by Triangle, in Mimstead, London and Warrington during February and March 2007. This presentation explains how real cost savings and resource savings can be made bu automating your ID and resource management, and what you might spend those cost savings on.
This document provides tips for writing LotusScript code for large systems with a focus on logging, performance, code reuse, and handling weird situations. Some key points include:
- Logging is important for stability and managing large systems. Recommends using OpenLog or creating and emailing log documents to avoid performance impacts.
- Views with click-sorted columns and unnecessary views hurt performance. Recommends minimizing views and avoiding click-sort.
- Agents need to be well-behaved to avoid overloading servers. Suggests profiling agents, breaking large tasks into multiple runs, and not relying on Agent Manager to kill misbehaving agents.
- Code reuse is important for maintenance. Recommends creating
3. Introduction
What is this about?
This talk aims to run through 30 different LotusScript tips
10 of these tips (Nursery Slopes) are fundamental
10 of these tips (Everyday Tips) are less well known
10 of these tips (Advanced Tips) are there to
provoke thought
4. Introduction (cont.)
Why 30 tips?
“The Lazy Programmer” methodology
Experience and understanding
Push your comfort zone and provoke thought
Who am I?
Bill Buchan
Dual PCLP in v3, v4, v5, v6, v7
10+ years senior development consultancy for
Enterprise customers
Learn from my pain!
5+ years code auditing
CEO – HADSL – developing best-practice tools
6. NS #1: Option Declare
You should always use “Option Declare”
Yes, but why?
If not, all variables are created at runtime as variants
This makes type-checking redundant
Data conversion costs 10x performance!
And means all errors will be runtime errors
Remember: Test lots, test early
Use the strengths of the compiler to help you
7. NS #2: Templates and Versions
In terms of custom code, you should always
Create templates with new code
Databases with “ntf” extension
Or databases with Master Template Name set
Create a separate copy for each version
Keep them in a central repository
Why?
It makes it far easier to roll back
Version control
Easier to construct test cases with “other” versions
8. NS #3: Application Lifecycle
You should always:
Develop in a development “sandbox”
Test in a user acceptance environment
Pass the template to your administrator to apply
Why?
It’s a basic change control system
Professionalism
It shakes out “hardcoded” bugs
Hardcoded server names, paths, replica IDs
It allows you to run extensive testing without
affecting production
9. NS #4: How to Code
How to code?
Code for maintenance
Only code for performance if required
Get it working before you get it working for speed
Why?
The highest cost in development is software maintenance
Make it easier for the person maintaining the application
It could be YOU
10. NS #5: “Measure Twice, Cut Once”
Spend more time thinking and less time coding
Try to think of at least TWO methods of solving
a problem
The best approach is usually a blend of the two
Think about the data model!
Why?
More planning, less work
“You know it’s been a rough night when you wake up next to some
code you don’t recognize”
- Bob Balaban
11. NS #6: Extending Arrays the Easy Way
Use “ubound” to establish the size of the array.
Sub initialize()
Dim myArray() as String
redim myArray(0)
call myExtend (myArray, “Hello Sailor”)
end sub
function myExtend(S() as String, ns as String) as integer
if (S(ubound(S)) <> “”) then redim preserve S(ubound(S)+1)
S(ubound(S)) = ns
extend = true
end function
Pros:
No need to keep separate index of array size, Automatically “trims”
Cons:
Slow with large arrays, Need to define some “empty” value
12. NS #7: The List Operator
Dim WR list as String
WR(“Peter”) = “Perfect”
WR(“Penelope”) = “Pitstop”
Print “Peter’s last name is: “ + WR(“Peter”)
if not isElement(WR(“Dick”)) then print “Dick isn’t racing!”
forall thisRacer in WR
Print listtag(thisracer) + “ “ + thisRacer
end forall
List stores a value with a unique lookup key
Pros:
It’s easy and it’s fast
It’s built right into LotusScript, since v4.5
Cons:
You can’t directly read and write a list from
a document item
– Convert to an array first
13. NS #8: Logging
If you have applications with scheduled Agents
Or if you have a diverse range of clients
Then you need to log your Agent (both client and scheduled) runtime status
Why?
Applications will break
You need to know when they break
Timing metrics for performance testing
Beware!
Don’t make the logging so slow that it affects application performance!
14. NS #9: Code Structure
Problem Decomposition:
Smaller code sequences are easier to:
Maintain – the majority of the cost
Reuse – if kept simple
Rule of thumb: If it’s more than a screenful – can it be broken up?
But – don’t be prescriptive
It’s all about
Problem decomposition
Maintainability
Code re-use
Get the data model right to start with!
15. NS #9: Code Structure (cont.)
Tips:
Keep functions/procedures/classes at a manageable size
But don’t be prescriptive
Think before decomposing problems
Discussion
“Declare at the top” or “Declare in the code”
I prefer to declare variables in the code
Comments
Don’t over comment – explain the “Why”!
I usually only comment non-intuitive algorithms
“This isn’t what you think … ”
Comment pseudocode to start with
16. NS #10: Code Hiding
Code hiding
Means decomposing your code so that consumers don’t see your code
Including yourself
Infers a logical interface (with clear naming!)
Customers/peers now write to the “interface”
Not the code itself
It simplifies the coding experience
How?
“Private/Public” methods in classes, script libraries, etc.
18. ED #1: Error Trapping
If I hear “I write perfect code. I don’t need error trapping,” I think of
two things
“Yeah, right”
“Fire this guy”
Error handling is mandatory. Seriously.
Now, how? Two routes:
Single error handler at the top, bubble errors up
Simple, but difficult keeping context
Error handler implemented at function level
More work, but much more granular
19. ED #2: Defensive Coding
Defensive coding is:
Assume the worst, check all input
On every function
Does this affect performance? Not usually
A typical function looks like:
Function mytest(p1 as String, p2 as String) as integer
mytest = false
if p1=”” then exit function
if p2=”” then exit function
...
' Now actually do something!
....
mytest = true
end function
20. ED #3: Protecting Code
Commercial applications need to hide their code. How?
Create a template and “hide design”
Pro: Easy
Con: You may allow form customization, etc.
Or remove LotusScript source code from script libraries
Use NotesNoteCollection to find script design document
Replace item “$ScriptLib” with a String – “Hello”
– Con: Not so simple
– Pro: Other design elements can be modified
Don’t do this on your development copy …
21. ED #4: Use NotesDateTime Instead of Strings!
Don’t store date/time values as Strings
Use NotesDateTime structures, and save them
Why?
You don’t know how the client will interpret dates …
Is it dd/mm/yyyy or mm/dd/yyyy?
It means that views will be able to sort on dates
This happens more often than you think!
22. ED #5: DXL as Transport
Consider the situation where your customer wants to send back
“log” documents easily
Use a LotusScript Agent to:
Pick up all selected documents
Create a Memo with a Rich Text Field
Use DXL to store the documents in the RT field
At the receiving end:
Unpack the mail message to a DXL Stream
Construct new documents to store the data
This is data transfer without replication
23. ED #5: DXL as Transport Example Code – Send
Dim sSession As New NotesSession
Dim dbThis As notesDatabase
Set dbThis = sSession.CurrentDatabase
Dim dc As NotesDocumentCollection
Set dc = dbThis.UnprocessedDocuments
If (dc Is Nothing) Then exit sub
If (dc.count < 1) Then exit sub
Dim doc As NotesDocument
Set doc = dc.GetFirstDocument
While (Not doc Is Nothing)
Dim de As NotesDXLExporter
Set de = sSession.CreateDXLExporter()
Call de.setInput(doc)
Actual Work
Dim dxl As String
dxl = de.Export
' continued overleaf..
24. ED #5: DXL as Transport Example Code – Send
Dim dbMail As New NotesDatabase("", "")
Call dbMail.OpenMail()
Dim docM As NotesDocument
Set docM = dbMail.CreateDocument
Call docM.ReplaceItemValue("Form", "Memo")
Call docM.ReplaceItemValue("Recipients", "logs@hadsl.com")
Call docM.ReplaceItemValue("SendTo", "logs@hadsl.com")
Call docM.ReplaceItemValue("Subject", "Log Documents”)
Dim rt As New NotesRichTextItem(docM, "Body")
Call rt.AppendText(dxl)
Call docM.Send(False)
Set docM = Nothing
Set de = Nothing
Set doc = dc.GetNextDocument(doc)
Wend
25. ED #6: Wizards
A Wizard interface in Notes Client:
Create a form with a tabbed table
Set the tabs to “1”, “2”, “3”, etc.
Select “Switch Rows Programmatically”
Set the “name” field to the name of the table
e.g., “RequestTable”
Create a variable on the form with $Name
e.g., “$RequestTable”
Have “forward” and “back” buttons increment/decrement
the variable
26. ED #7: Consuming Web Services
Two approaches
Quick and dirty
Install MS Soap on client machines
Write LotusScript to create an MS Soap Object
– Pro: Very quick, handy for testing
– Con: Platform specific, requires DLL
on clients, no timeout
Dim Client As Variant
Set Client = CreateObject("MSSOAP.SoapClient")
'Initialize connection to the Web Service
Call Client.mssoapinit ("http://localhost/testWS.nsf/Simple?wsdl")
'Call our simple GetEmailAddress function provided by Web service
Dim result As String
result = Client.getJoke()
'output result to message box
Messagebox result, 48, "Get Joke"
27. ED #7: Consuming Web Services (cont.)
Second Approach
Big and robust
Use “Stubby”
http://www.openNtf.org
Point it at a web service
It produces the code for you!
Pro:
Multi-platform, scalable
No DLL’s
Con
Its more than 4 lines of code.
28. ED #8: Classes
What are Classes?
Classes help to:
Bundle data and code in one place
Decompose problems into “objects”
Write smaller, more focused code
Define and implement the internal data model
Classes aid reusability
Pros: Good design methodology, leads to Java
Cons: “Different,” and takes time to sink in
29. ED #8: Classes (cont.)
Class Person
private nName as NotesName
private strUNID as String
sub new(strNewName as string, strNewUNID asString)
me.nnName = new NotesName(strNewName)
me.strUNID = strNewUNID
end sub
public function getName as String
if (me.nnName is nothing) then exit function
getName = nnName.Canonical
end function
public function getUNID as String
getUNID = strUNID
end function
end class
30. ED #9: Evaluate
Evaluate allows you to run @Functions within LotusScript
Sometimes faster, easier
Example:
evaluate(|@unique|)
DON’T:
Overuse it. Lots of LotusScript functions mimic @functions.
“strRight” == @StrRight
31. ED #10: “Trusted Servers”
Scheduled Agents cannot normally open databases on other servers
“Trusted Servers” field in R6 server document, security section, allows servers to
“trust” other servers
This allows you to centralize “collection” Agents
Caveat: Don’t trust servers in another domain!
Pros:
Simplifies architecture
Fewer Agents
Con:
Relies on fast, reliable network infrastructure …
33. Advanced #1: Understanding Binding
There are two types of binding
Early: Set by the compiler
Pros: Type checking, speed, and ease of use
Example: “Dim S as String”
Late: Set at runtime
Pros: Flexibility, NO type checking
Cons: Performance, runtime errors
Dim V as variant
Dim S as new NotesSession
set V = S.CurrentDatabase
print V.getTitle()
34. Advanced #2: Coding for Performance
Remember – Expensive operations include:
Opening databases and views
Documents with lots of fields
When collecting data:
Cache views where possible
Use NotesViewEntry instead of opening documents
Example:
100,000 document database
7 hours for “open every document in database”
Not using views
60 minutes using NotesView and opening documents
12 minutes for “notesviewEntry”
35. Advanced #3: Lists and Classes
Classes bind complex data and operations - List looks these up
quickly in memory
Example – Let’s extend our Person class:
dim People list as Person
dim PeopleByUNID list as Person
Dim P as new Person(“Joe Bloggs/ACME”, “010101010201020”)
....
set People(P.getName) = P
set PeopleByUNID(P.getUNID) = P
if (isElement(People(“Joe Bloggs/ACME”))) then _
Print “Joe's UNID is: “ + People(“Joe Bloggs/ACME”).getUNID
if (isElement(PeopleByUNID(“010101010201020”))) then _
Print “UNID '010101010201020' is: “ + _
PeopleByUNID(“010101010201020”).getName
36. Advanced #4: Class Inheritance
Class inheritance allows us to “Extend” classes to
add functionality
class StaffPerson as Person
private strStaffID as String
sub new(strNewPerson as String, strNewUNID as String)
end sub
public function setStaffNumber(newNo as String)
strStaffID = newNo
end function
public function getStaffNumber as String
getStaffNumber = me.strStaffID
end function
end class
37. Advanced #5: Platform-Specific Code With Classes
Dim s as new NotesSession Class getMem
Dim mem as variant function getMem() as long
getMem = 0
select case s.platform end function
case “Windows/32” sub printMemory
set mem = new getMemW32() print me.getMem()
case “AIX” end sub
set mem = new getMemAIX() end class
case else
Print “Platform not supported” Class getMemW32 as getMem
set mem = nothing function getMem() as long
end case getMem = getWindowsMemory()
end function
if (not mem is nothing) then end class
call mem.printMemory()
Class getMemAIX as getMem
function getMem() as long
getMem = getAIXMemory()
end function
end class
38. Advanced #6: Version-Specific Code With Classes
Class createUser
Dim s as new NotesSession function createUser(...) as integer
dim vCU as variant ....
end function
select case s.version end class
case 5
set vCU = new createUser()
case 6
set vCU = new createUserv6() Class createUserv6 as createUser
case else function createUser(...) as integer
Print “Version not supported” ....
set vCU = nothing end function
end case end class
if (not vCU is nothing) then _
call vCU.CreateUser(....)
39. Advanced #7: LSI_Info()/GetThreadInfo
LSI_INFO() gives some runtime information
Superceded by GetThreadInfo
GetThreadInfo(11) gives calling class
GetThreadInfo(10) gives function name
and lots more …
Why?
Error trapping: We can track where we came from
We don’t have to pass lists of parameters to error
trapping code
Prevents “cut-n-paste coding” errors ...
40. Advanced #7: LSI_Info()/GetThreadInfo (cont.)
Function RaiseError() ' calling code...
Dim thisType As String ...
Dim es as String ExitFunction:
thisType = Typename(Me) exit function
errorhandler:
' Not a class, use the calling module instead Call RaiseError()
If (thisType = "") Then thisType = Getthreadinfo(11) resume exitFunction
end function
es = thisType & "::" & Getthreadinfo(10) & ": "
If (Err = 0) Then
es = es + "Manually raised an error"
Else
es = es + "Run time error: (" + Trim(Str(Err)) + ") " + _
Error$ + " at line: "+ Trim(Str(Erl))
End If
Print es
end function
41. Advanced #8: Execute
Execute runs LotusScript code from a String
• Example:
Dim executeString as String
executeString = |
print “Hello world”
dim s as new NotesSession
dim db as NotesDatabase
set db = s.currentDatabase
print “Current Database name is: “ + db.Title
|
execute (executeString)
• Why?
Accomodates version/platform differences at runtime
42. Advanced #9: Advanced Logging
OpenNtf “OpenLog” solution:
Simple script library addition to your code
Provides “called from”, “error”, and “Line number” functionality
Simple to implement
Example of our “NSD” system:
On error trap
Displays all objects in memory
43. Advanced #10: Mixing Java and LotusScript
Use each language to its strengths
Java – good for Web services, network I/O, multithreaded operations
LotusScript – traditional Notes development language, works in UI
How to mix:
Simple: Call an Agent, passing a Notes document
Fast. I didn’t say you had to save the document!
Works both ways
LS2J
Call Java from LotusScript
Example on the next slide ...
44. Advanced #10: Mixing Java and LotusScript …
// Create a Script Library of type “Java” called xlib
// containing the following function:
public class calculator {
Option Public
public int add(int a, int b) { return a + b; }
Use "xlib"
public int div(int a, int b) { return a / b; }
Uselsx "*javacon"
public int mul(int a, int b) { return a * b; }
public int sub(int a, int b) { return a - b; }
Sub Initialize
}
Dim mySession As JavaSession
Dim myClass As JavaClass, calculator As JavaObject, a,b,c As Integer
Set mySession = New JavaSession()
Set myClass = mySession.GetClass("calculator")
Set calculator = myClass.CreateObject()
a = 10
b=5
c = calculator.mul(a,b)
MessageBox "a * b = " & c
End Sub
48. Resources (cont.)
Brian Benz and Rocky Oliver, Lotus Notes and Domino 6
Programming Bible (Wiley 2003).
www.amazon.com/gp/product/0764526111
Notes.Net (of course)
www.notes.net
All my presentations and materials are available on my blog:
http://www.billbuchan.com
The View magazine
http://www.eView.com
Lotus Advisor
http://www.lotusAdvisor.com
49. Questions and Answers
Limited Time for Questions
I’m available in the speaker room immediately after this session.
Remember to fill in your Evaluations.
This is how YOU influence Lotusphere 2008!