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.
Presentation from Engage 2022 in Bruges
From day to day administration to advanced configuration from automated maintenance to running the best multi client mail server on the market, from advanced security to data access.
Domino Server Health - Monitoring and ManagingGabriella Davis
If you're a Domino administrator how do you decide what to monitor on your servers and how to manage them ? What are the key things to monitor? How do good practice management tools such as statistics reporting, DDM, cluster symmetry, database repair and policy settings make your work lighter and faster. Finally we’ll talk about some of the “must dos” in the day, week and month of a Domino admin.
Presented at Engage.ug in Brussels May 2019
How to deliver industry standard browser security to the native Domino HTTP stack, using company-wide wildcard certificates deployed across all platforms.
Are your servers running out of disk space? Do you have more than one bit like attachment stored in your databases? Does a standard task like fixup lasts for ages or does your backup still runs during working hours? Do you have quota enabled and your users are asking for more space?
If you can answer one or more of these questions with YES, than this session is for you.
Maximize the disk space savings provided by Domino Attachment and Object Service (DAOS) and ensure that your environment is properly configured for best performance with this feature. Save more space by simply enabling design and document compression. Make sure that your attachments use best compression too. Reduce network bandwidth when replicating databases between servers and increase mail quotas without using more disk space.
Target audience is administrators or decision makers who want to know more about some older but not yet used space savers and especially about DAOS.
Presentation held on 30-Mar-2010 at the BLUG conference in Brussels.
Presentation from Engage 2022 in Bruges
From day to day administration to advanced configuration from automated maintenance to running the best multi client mail server on the market, from advanced security to data access.
Domino Server Health - Monitoring and ManagingGabriella Davis
If you're a Domino administrator how do you decide what to monitor on your servers and how to manage them ? What are the key things to monitor? How do good practice management tools such as statistics reporting, DDM, cluster symmetry, database repair and policy settings make your work lighter and faster. Finally we’ll talk about some of the “must dos” in the day, week and month of a Domino admin.
Presented at Engage.ug in Brussels May 2019
How to deliver industry standard browser security to the native Domino HTTP stack, using company-wide wildcard certificates deployed across all platforms.
Are your servers running out of disk space? Do you have more than one bit like attachment stored in your databases? Does a standard task like fixup lasts for ages or does your backup still runs during working hours? Do you have quota enabled and your users are asking for more space?
If you can answer one or more of these questions with YES, than this session is for you.
Maximize the disk space savings provided by Domino Attachment and Object Service (DAOS) and ensure that your environment is properly configured for best performance with this feature. Save more space by simply enabling design and document compression. Make sure that your attachments use best compression too. Reduce network bandwidth when replicating databases between servers and increase mail quotas without using more disk space.
Target audience is administrators or decision makers who want to know more about some older but not yet used space savers and especially about DAOS.
Presentation held on 30-Mar-2010 at the BLUG conference in Brussels.
Zusammenführung von HCL Nomad Web und Domino ohne SafeLinx - So gehtspanagenda
Webinar Recording: https://www.panagenda.com/webinars/zusammenfuhrung-von-hcl-nomad-web-und-domino-ohne-safelinx-so-gehts/
HCL Nomad Web ist der Weg in die Zukunft. Die Benutzer können frei entscheiden, wann, wo und wie sie die Anwendung nutzen wollen. Das ermöglicht nicht nur größere betriebliche Flexibilität, sondern trägt auch zu einer höheren Mitarbeiterbindung und Produktivität bei. Und wenn Sie HCL Nomad Web und Domino ohne SafeLinx betreiben, wird der Weg in die Zukunft noch viel einfacher.
Nun, Ihr Ziel ist gesteckt. Sie wollen Nomad Web nutzen – den neuen Client im Browser. Dabei gibt es leider noch einige Hürden zu überwinden. Glücklicherweise beseitigt Domino 12.0.2 eine große Hürde. Der neue Nomad Web Server auf Domino macht es möglich, dass Nomad Web direkt mit Domino kommuniziert. SafeLinx ist nunmehr optional. Es geht auch ohne zusätzliche Komplexität.
Nehmen Sie am 13. Dezember an diesem Webinar teil, in dem Marc Thomas, HCL Ambassador & panagenda Senior Consultant, Ihnen Tipps und Tricks aus der Praxis zeigt. Erwerben Sie die Fähigkeiten, die Sie benötigen, um Nomad Web direkt mit Domino zu betreiben und HCL Nomad Web und Domino ohne SafeLinx zu nutzen. Sie erhalten in diesem Webinar ein fertiges Rezept, mit dem Sie in Ihrer Umgebung loslegen können.
In unserem Webinar über die Ausführung von HCL Nomad-Konfigurationen auf jedem Gerät haben wir Ihnen gezeigt, dass MarvelClient Roaming Ihnen helfen kann, viele Herausforderungen zu lösen. Es ermöglicht Ihnen die automatische Sicherung, Wiederherstellung und gemeinsame Nutzung von Konfigurationen (Desktop, aktuelle Anwendungen, Einstellungen und mehr) auf verschiedenen Geräten mit Nomad. Es lädt Konfigurationen auf Ihre Domino-Server hoch, sobald sie geändert werden, und aktualisiert dann auf transparente Weise alle aktuellen und neuen Geräte, die von derselben Person verwendet werden, mit minimalen Netzwerk- und Verarbeitungsanforderungen. Dieses Mal gehen wir noch ein bisschen weiter.
Dabei gehen wir besonders auf die folgenden Themen ein:
- Inbetriebnahme von HCL Nomad Web und Domino ohne SafeLinx
- Wie Sie Nomad Web Server schnell installieren und konfigurieren
- Wie der Nomad Web Server aus der Sicht eines Benutzers funktioniert
- Szenarien, in denen der Einsatz von SafeLinx weiterhin sinnvoll ist
In this session (reloaded for Notes V11), you will learn how easy it can be to maximize Notes client performance. Let Chris show you, what can be tuned and how to resolve the best possible performance for your Notes client infrastructure. Discover tips and tweaks - how to debug your Notes client, deal with outdated ODS, network latency and application performance issues and the measurable benefit that provides to your users. You’ll discover the current best practices for streamlining location and connection documents and why the catalog.nsf is still so important. You will leave the session with the knowledge you need to improve your Notes V11 client installations and to provide a better experience for happier administration and happier end-users!
The Ultimate Administrator’s Guide to HCL Nomad Webpanagenda
Webinar Recording: https://www.panagenda.com/webinars/the-ultimate-administrators-guide-to-hcl-nomad-web/
HCL Nomad Web is THE talk around the watercooler. More and more companies are looking into supplementing or outright replacing their Notes clients with this new browser based HCL solution. But doing so is a daunting prospect, given the many new technologies in play. To help you out, we went and collected everything you need to know in one place. Getting HCL Nomad Web up and running – start to finish, with live demos – only here!
Join HCL Ambassador Christoph Adler in this unmissable event for HCL administrators. Everything you see here you can put to good use immediately, as all tools are available with your HCL CCB license or are even free to use. Whether you already are using it, have just decided to start your HCL Nomad journey, or only want to see what it would mean to go down this path: if you don’t want to be left in the past, you must not miss this webinar!
What you will learn
- Understanding requirements, benefits, and limitations of HCL Nomad Web
- Installing HCL Nomad Web on the server (with or without HCL SafeLinx)
- Performing initial setup for end-users while preserving the workspace from their Notes clients
- Dealing with virtual infrastructures such as Citrix, VMWare, TS, and VDI
- Operating, optimizing, and troubleshooting on servers and clients
Session from NCUG. Stockholm 12.06.2019.
Basic Domino Performance Tuning. Ideas how to improve performance, statistics how to get information that we have issues and how to fix them
HCL Notes and Nomad Troubleshooting for Dummiespanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-nomad-troubleshooting-for-dummies/
The number of systems IT and support have to handle is growing faster and faster, while headcounts in those departments struggle to keep pace. This means less and less time to deal with any single system (like Notes), which leads to reduced operational efficiency. On top of that, newer personnel is often also unfamiliar with the HCL stack.
Come and join Christoph Adler on April 18 who will condense their whopping 20+ years of field experience with HCL Notes and Nomad troubleshooting into a single webinar. Get an eye-opening boost in knowledge and skills – whether you are an inquiring beginner or a seasoned admin. Benefit from real uses cases we encountered in the wild to learn how you can quickly and easily deal with many common situations and find out what to do if you can’t solve it on your own.
What you will learn
- Learn how to react fast and what to do when things go wrong with Notes or Nomad, and how to isolate and/or reproduce the issue.
- Understand where to look for information (logs, NSDs, etc.), how to easily collect it, and how to interpret what you find.
- Accelerate time to resolution when escalating to HCL support by having all the right things in hand from the start.
Domino Tech School - Upgrading to Notes/Domino V10: Best PracticesChristoph Adler
Are you looking to deploy Domino V10 but don’t know where to start? Upgrade servers or clients first? Should I upgrade the ODS? If you have questions like these, this session is for you. Get a complete understanding of the process to upgrade to Domino V10, and learn from best practices and tips from the field.
How to configure IWA / SPNEGO for IBM Domino enabling Windows authenticated users to access Domino web applications without being prompted for further authentication
[Session given at Engage 2019, Brussels, 15 May 2019]
In this session, Tim Davis (Technical Director at The Turtle Partnership Ltd) takes you through the new Domino Query Language (DQL), how it works, and how to use it in LotusScript, in Java, and in the new domino-db Node.js module. Introduced in Domino 10, DQL provides a simple, efficient and powerful search facility for accessing Domino documents. Originally only used in the domino-db Node.js module, with 10.0.1 DQL also became available to both LotusScript and Java. This presentation will provide code examples in all three languages, ensuring you will come away with a good understanding of DQL and how to use it in your projects.
Admin Tips In 60 Minutes
In this high speed session I take you through the best admin tips for Domino, Notes, Sametime, Traveler and more. From notes.ini values, to server configuration settings and valuable customisations.
Some tips will be new to v10 and some have been around but rarely used for years.
Whatever your experience there will be something new for you to take away and enjoy.
Presented at Engage.ug in Brussels May 2019
The Lotus Code Cookbook - Ulrich Krause
Tipps, Tipps, Tipps ... Die Session behandelt kein zentrales Thema. In loser Folge werden Tipps und Tricks aus allen Bereichen der Programmierung in Lotus Notes / Domino vorgestellt. @Formula, LotusScript, Java, JavaScript, LS2CApi.
Zielgruppe sind Alle, die sich mit Applikationsentwicklung beschäftigen. Anfänger und "alte Hasen"; es ist für jeden etwas dabei.
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!
Zusammenführung von HCL Nomad Web und Domino ohne SafeLinx - So gehtspanagenda
Webinar Recording: https://www.panagenda.com/webinars/zusammenfuhrung-von-hcl-nomad-web-und-domino-ohne-safelinx-so-gehts/
HCL Nomad Web ist der Weg in die Zukunft. Die Benutzer können frei entscheiden, wann, wo und wie sie die Anwendung nutzen wollen. Das ermöglicht nicht nur größere betriebliche Flexibilität, sondern trägt auch zu einer höheren Mitarbeiterbindung und Produktivität bei. Und wenn Sie HCL Nomad Web und Domino ohne SafeLinx betreiben, wird der Weg in die Zukunft noch viel einfacher.
Nun, Ihr Ziel ist gesteckt. Sie wollen Nomad Web nutzen – den neuen Client im Browser. Dabei gibt es leider noch einige Hürden zu überwinden. Glücklicherweise beseitigt Domino 12.0.2 eine große Hürde. Der neue Nomad Web Server auf Domino macht es möglich, dass Nomad Web direkt mit Domino kommuniziert. SafeLinx ist nunmehr optional. Es geht auch ohne zusätzliche Komplexität.
Nehmen Sie am 13. Dezember an diesem Webinar teil, in dem Marc Thomas, HCL Ambassador & panagenda Senior Consultant, Ihnen Tipps und Tricks aus der Praxis zeigt. Erwerben Sie die Fähigkeiten, die Sie benötigen, um Nomad Web direkt mit Domino zu betreiben und HCL Nomad Web und Domino ohne SafeLinx zu nutzen. Sie erhalten in diesem Webinar ein fertiges Rezept, mit dem Sie in Ihrer Umgebung loslegen können.
In unserem Webinar über die Ausführung von HCL Nomad-Konfigurationen auf jedem Gerät haben wir Ihnen gezeigt, dass MarvelClient Roaming Ihnen helfen kann, viele Herausforderungen zu lösen. Es ermöglicht Ihnen die automatische Sicherung, Wiederherstellung und gemeinsame Nutzung von Konfigurationen (Desktop, aktuelle Anwendungen, Einstellungen und mehr) auf verschiedenen Geräten mit Nomad. Es lädt Konfigurationen auf Ihre Domino-Server hoch, sobald sie geändert werden, und aktualisiert dann auf transparente Weise alle aktuellen und neuen Geräte, die von derselben Person verwendet werden, mit minimalen Netzwerk- und Verarbeitungsanforderungen. Dieses Mal gehen wir noch ein bisschen weiter.
Dabei gehen wir besonders auf die folgenden Themen ein:
- Inbetriebnahme von HCL Nomad Web und Domino ohne SafeLinx
- Wie Sie Nomad Web Server schnell installieren und konfigurieren
- Wie der Nomad Web Server aus der Sicht eines Benutzers funktioniert
- Szenarien, in denen der Einsatz von SafeLinx weiterhin sinnvoll ist
In this session (reloaded for Notes V11), you will learn how easy it can be to maximize Notes client performance. Let Chris show you, what can be tuned and how to resolve the best possible performance for your Notes client infrastructure. Discover tips and tweaks - how to debug your Notes client, deal with outdated ODS, network latency and application performance issues and the measurable benefit that provides to your users. You’ll discover the current best practices for streamlining location and connection documents and why the catalog.nsf is still so important. You will leave the session with the knowledge you need to improve your Notes V11 client installations and to provide a better experience for happier administration and happier end-users!
The Ultimate Administrator’s Guide to HCL Nomad Webpanagenda
Webinar Recording: https://www.panagenda.com/webinars/the-ultimate-administrators-guide-to-hcl-nomad-web/
HCL Nomad Web is THE talk around the watercooler. More and more companies are looking into supplementing or outright replacing their Notes clients with this new browser based HCL solution. But doing so is a daunting prospect, given the many new technologies in play. To help you out, we went and collected everything you need to know in one place. Getting HCL Nomad Web up and running – start to finish, with live demos – only here!
Join HCL Ambassador Christoph Adler in this unmissable event for HCL administrators. Everything you see here you can put to good use immediately, as all tools are available with your HCL CCB license or are even free to use. Whether you already are using it, have just decided to start your HCL Nomad journey, or only want to see what it would mean to go down this path: if you don’t want to be left in the past, you must not miss this webinar!
What you will learn
- Understanding requirements, benefits, and limitations of HCL Nomad Web
- Installing HCL Nomad Web on the server (with or without HCL SafeLinx)
- Performing initial setup for end-users while preserving the workspace from their Notes clients
- Dealing with virtual infrastructures such as Citrix, VMWare, TS, and VDI
- Operating, optimizing, and troubleshooting on servers and clients
Session from NCUG. Stockholm 12.06.2019.
Basic Domino Performance Tuning. Ideas how to improve performance, statistics how to get information that we have issues and how to fix them
HCL Notes and Nomad Troubleshooting for Dummiespanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-nomad-troubleshooting-for-dummies/
The number of systems IT and support have to handle is growing faster and faster, while headcounts in those departments struggle to keep pace. This means less and less time to deal with any single system (like Notes), which leads to reduced operational efficiency. On top of that, newer personnel is often also unfamiliar with the HCL stack.
Come and join Christoph Adler on April 18 who will condense their whopping 20+ years of field experience with HCL Notes and Nomad troubleshooting into a single webinar. Get an eye-opening boost in knowledge and skills – whether you are an inquiring beginner or a seasoned admin. Benefit from real uses cases we encountered in the wild to learn how you can quickly and easily deal with many common situations and find out what to do if you can’t solve it on your own.
What you will learn
- Learn how to react fast and what to do when things go wrong with Notes or Nomad, and how to isolate and/or reproduce the issue.
- Understand where to look for information (logs, NSDs, etc.), how to easily collect it, and how to interpret what you find.
- Accelerate time to resolution when escalating to HCL support by having all the right things in hand from the start.
Domino Tech School - Upgrading to Notes/Domino V10: Best PracticesChristoph Adler
Are you looking to deploy Domino V10 but don’t know where to start? Upgrade servers or clients first? Should I upgrade the ODS? If you have questions like these, this session is for you. Get a complete understanding of the process to upgrade to Domino V10, and learn from best practices and tips from the field.
How to configure IWA / SPNEGO for IBM Domino enabling Windows authenticated users to access Domino web applications without being prompted for further authentication
[Session given at Engage 2019, Brussels, 15 May 2019]
In this session, Tim Davis (Technical Director at The Turtle Partnership Ltd) takes you through the new Domino Query Language (DQL), how it works, and how to use it in LotusScript, in Java, and in the new domino-db Node.js module. Introduced in Domino 10, DQL provides a simple, efficient and powerful search facility for accessing Domino documents. Originally only used in the domino-db Node.js module, with 10.0.1 DQL also became available to both LotusScript and Java. This presentation will provide code examples in all three languages, ensuring you will come away with a good understanding of DQL and how to use it in your projects.
Admin Tips In 60 Minutes
In this high speed session I take you through the best admin tips for Domino, Notes, Sametime, Traveler and more. From notes.ini values, to server configuration settings and valuable customisations.
Some tips will be new to v10 and some have been around but rarely used for years.
Whatever your experience there will be something new for you to take away and enjoy.
Presented at Engage.ug in Brussels May 2019
The Lotus Code Cookbook - Ulrich Krause
Tipps, Tipps, Tipps ... Die Session behandelt kein zentrales Thema. In loser Folge werden Tipps und Tricks aus allen Bereichen der Programmierung in Lotus Notes / Domino vorgestellt. @Formula, LotusScript, Java, JavaScript, LS2CApi.
Zielgruppe sind Alle, die sich mit Applikationsentwicklung beschäftigen. Anfänger und "alte Hasen"; es ist für jeden etwas dabei.
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!
This is a presentation I did for the Cedar Rapids .NET User Group (CRineta.org). It was intended to present object oriented concepts and their application in .NET and C#.
These questions will be a bit advanced level 2sadhana312471
These questions will be a bit advanced(Intermediate) in terms of Python interview.
This is the continuity of Nail the Python Interview Questions.
The fields that these questions will help you in are:
• Python Developer
• Data Analyst
• Research Analyst
• Data Scientist
Object Oriented Programming For Engineering Students as well as for B.Tech -IT. Covers Almost All From The Basics.
For more:
Google Search:: Prabhaharan Ellaiyan
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
3. Introduction
Who am I?
Bill Buchan, HADSL
23 years IT experience, 12 with Lotus Notes
Dual PCLP in v3, v4, v5, v6, v7
Founder and CEO of a Business Partner – HADSL – in the UK
I was 40 years old on Sunday. Something a lot of people thought would
never happen…
Who are you ?
A LotusScript developer
You wish to improve your code, write more efficiently, & write more robust code
You have used some object orientated programming techniques already.
Or you’re a very fast learner…
4. Agenda
Introductions
What is Object Orientated Programming?
Basic OO techniques
Advanced OO techniques
Summary
Questions and Answers
5. Why Object Orientated Programming?
Object Orientated Programming:
Allows you to design higher-level objects.
Allows far more code-reuse.
Allows you to write less code.
And therefore leads to easier maintenance.
Using OOP, we can componentise the manufacture of objects within
our application
And use common techniques to deal with those objects.
6. Objects – Public and Private:
An object has to have
some public methods (functions/subs).
may have public members (variables).
Internal code for the object need not be exposed
“Code Hiding” means not showing the consumer more than he needs to see.
Importantly – the consumer now codes to the public interface of that object.
NotesSession
CurrentDatabase
InternalVariable SendConsoleCommand()
InternalFunction()
7. How to design an Object Orientated Application
Decide which objects make sense in terms of the problem space.
Make the object represent logical entities within the application.
“Person”, “PersonCollection”, “Transaction”, etc are good examples.
Write these object names down on separate pieces of paper
Perform an application “walk through”
This will quickly show which objects need to perform particular operations, and
which objects interact with other objects.
This helps define the “public” interface to the Object.
Don’t worry as to how operations within objects are performed at this stage.
Note:
More sophisticated approaches exist.
Remember, OO programming is common in other environments.
8. OOP & LotusScript
To create a class in LotusScript, wrap code and data around “class”
definitions. Such as:
Class Person
Private nnName as NotesName
Public strInternetAddress as String
Sub new(doc as NotesDocument)
Set nnName = doc.GetitemValue(“FullName”)(0)
me.strInternetAddress = doc.getItemValue(“InternetAddress”)(0)
End sub
Public function getName
If (me.nnName is nothing) then exit function
getName = nnName.Abbreviated
End function
End class
Dim P as new Person(doc)
And consume it with: Print “Person: “ + P.getName()
9. Constructors and Destructors
“Sub New()” in a LotusScript Class is its “constructor”
It is executed automatically when the class is constructed.
If the class is inherited, then the parent class’s constructor is ran first.
This means that you need not know how the parent class constructor works
If you change the constructor in one class, you need not update code in any
sub-classes constructors.
You can pass parameters to it.
Useful for code setup.
“Sub Delete()” in a LotusScript class is its “destructor”
It is executed automatically when the object is out-of-scope, or is deleted.
Useful for clean-up code.
Very useful for disposing of critical memory objects!
C-API programming, COM objects, etc.
10. Why does that help ?
It helps us construct complex (and possibly interconnected) in-
memory data structures
It sites the code for that data structure alongside the data structure
Making maintenance easier
We can use these complex data structures to represent far more
complex algorithms.
We can architect solutions at a far higher level, using objects
(instances of these classes).
Classes can inherit from other classes, thus aiding code re-
use(dramatically).
11. Where does this help us ?
Complex code.
Large applications.
Applications that have or may change data structure frequently.
Object Orientated Programming helps segregate objects from each other,
insulating against data or structure changes.
Groups of applications that share common data structures.
12. Examples:
Directory Comparison tools.
Its far faster to read multiple directories into memory and perform comparisons
between in-memory objects.
Workflow systems
Where you can “hide” the complexity of the workflow from other code.
Interfaces to External Systems
Where the Interface can be complex.
Or where you wish to support multiple interfaces.
Where you are attempting to perform complex relational
operations.
14. Lets make some assumptions
These techniques will probably not help in very small projects
These techniques are overkill for simple algorithms
Where these techniques are invaluable are in
Large data operations
Relational data operations, where entire data sets have to be compared
For instance, directory comparison routines
Interface code – interfacing a Notes database to something else
For instance, a relational database
Try not to be prescriptive
Keep it simple!
15. Organising Objects with Lists
Lists. A collection construct that’s always been in LotusScript.
You can construct a memory construct where you have zero or
more items in a list, and each item is referenced by a lookup value.
Like an in-memory “view”.
How many people know how to use lists ?
Resources:
The View – December 2006 article.
http://www.billbuchan.com/web.nsf/htdocs/BBUN67JJCV.htm
Can Lists work with Classes ?
Of course!
16. Lets make a list of Person Objects
Store Person Objects by Name:
Class Person Dim vLookup as NotesView
Private nnName as NotesName …
Sub new(doc as NotesDocument) Dim doc as NotesDocument
Set nnName = doc.FullName(0) Set doc = vLookup.GetFirstDocument()
End sub Dim People list as Person
Public function getName While not doc is nothing
If (me.nnName is nothing) then exit function dim P as new Person(doc)
getName = nnName.Abbreviated set People(P.getName) = P
End function set doc = vLookup.GetNextDocument(doc)
End class wend
17. Why is this significant ?
A list is a very efficient (for both memory and performance).
Consider it to be the same as a view containing documents.
But everything is in memory – therefore 1,000x faster.
Because of its low memory footprint.
Its more efficient to have multiple lists in memory than attempt complex
operations on a single list.
18. Extending Classes
Classes can be extended from other classes, and inherit
code+properties.
Class baseClass
This leads to code-reuse.
…
If more code is added to Private Function log(msg as String)
BaseClass, this is available …
to PersonClass end function
End class
Class PersonClass as BaseClass
….
sub new(doc as NotesDocument)
….
call me.log(“Started”)
….
end sub
End class
19. Extending Classes…
When one class is extended from another class
It inherits all code and data from that original class.
It can execute private methods and access private members of the parent
classes.
There is no limit to the level of inheritance
But don’t go mad
BaseClass
For instance:
UIClass RequestClass FactoryClass
UserCreateUIClass
UserMoveUIClass UserCreateRequestClass
UserRenameUIClass UserMoveRequestClass
UserDeleteUIClass UserRenameRequestClass
UserDeleteRequestClass
UserCreateRequestClassv6
20. Inheritance Trees and Code Placement
Inheriting all classes from a common root means
Common code can be placed high in the inheritance tree and be used by all.
If this code changes, its only changed in one place.
Lots of code reuse.
Examples of Infrastructure code might be:
Logging.
Persistence.
Error trapping.
Configuration.
New code can be placed at the relevant level in the tree.
Each individual class can be kept to a manageable size:
No 1,300 line functions!
Architectural decisions can be followed - No “Design Drift”.
21. Inheritance
Note that in large systems:
You may end up with Classes that are not used by the application itself, but are
placeholders for inheritance points and inherited code/data.
This is not a bad thing! It keeps the design “clean”, and keeps infrastructure
code out of your business objects!
You may wish to use the Factory design pattern
Where one class is responsible for creating instances of other classes.
It’s a useful point for deciding whether an object is a Singleton or not.
Its also a place to keep lists of all classes that are created:
Useful for NSD-Style error trapping analysis!
22. Version/Platform Specific code insulation
Class inheritance allows you to insulate code from version or
platform differences
For instance, a class may be written using v5 features
A v6 version of the class can be created which inherits from the v5 class, but
only overrides the version-specific code
To make this simple
Group version specific code into particular functions which can be easily
identified and overridden.
23. Version/Platform Specific code insulation - Example
Class personClass Dim S as new NotesSession
… Dim P as variant
Private Function createUser(userName as String) as integer If S.NotesBuildVersion < 170 then
… ‘ Its v5
end function set P = new PersonClass()
End class Else
‘ V6 and above.
Class PersonClassV6 as PersonClass
set P = newPersonClassV6()
Private Function createUser(userName as String) as integer
End if
‘ place v6 specific code here
end function
‘ Use P as normal from now on.
End class
Note that the V6 class usually ONLY contains
functions that have been overridden. It
may be very small.
1. Good Code Reuse.
2. Business Logic remains in one place.
24. Inheritance Trees and Code Placement - Example
Infrastructure BaseClass
Common UI Features UIClass RequestClass FactoryClass
UserCreateUIClass
UserMoveUIClass UserCreateRequestClass
UserRenameUIClass UserMoveRequestClass
UserDeleteUIClass UserRenameRequestClass
UserDeleteRequestClass
Version Specific Code UserCreateRequestClassv6
25. BaseClass Specification
We would like to put some form of logging into our Baseclass
However, lots of other objects will inherit from BaseClass.
Our Baseclass cannot create a new NotesAgentLog class for each
instance.
We need to only create ONE single instance of our NotesAgentLog class.
LogClass
BaseClass
BaseClass
Site BaseClass
Site
SiteClass
BaseClass
BaseClass
Person
BaseClass
Person
BaseClass
Person
PersonClass
26. The Singleton Design Pattern
“Singleton” is a design pattern which ensures that ONLY one copy
of an object exists at one time:
Class baseClass Private globalLog as Variant
private log as variant Public Function getNewLog() as variant
Sub new() if (isEmpty(globalLog)) then
set log = getNewLog() set globalLog = new logClass
End sub end if
Private Function log(msg as String) set getNewLog = globalLog
call log.writeMsg(msg) End function
end function Class logClass
End class public Function writeMsg(msg as String)
…
end function
End class
27. Infrastructure Code: Configuration
Typically, a large application will have lots of configuration values
Hard coded design decisions can be exposed as configuration variables
This makes the application far more useful.
Allows the application to be used in ways not originally envisaged at design
time, without code changes.
Flexibility – whilst a positive thing – does come at a price
Configuration variables have to be exposed, checked and read at Run-time.
I could have a single configuration profile document and a single
configuration object
BaseClass could then link to that as a Singleton at run time.
Making all configuration options available to all objects in memory.
28. Infrastructure Code: Persistence
“Persistence” is the ability of an object to make itself persistent
between executions
We could easily add a NotesDocument, and methods to manipulate
that document available in the BaseClass
However, the BaseClass cannot know the layout of objects inherited
from it
Therefore objects that inherit from BaseClass must have their own persistence
routines coded which make use of the hooks from BaseClass.
An object need not be persistent
Nor does it need to “save” itself between runs – it might only “read” itself from a
profile document.
29. Infrastructure code: Error Trapping
BaseClass is a good place to put a single error trapping routine:
Function RaiseError() as integer
Dim thisType As String, es as String
thisType = Typename(Me) ' calling code...
...
' Not a class, use the calling module instead ExitFunction:
If (thisType = "") Then thisType = Getthreadinfo(11) exit function
errorhandler:
es = thisType & "::" & Getthreadinfo(10) & ": " Call RaiseError()
resume exitFunction
If (Err = 0) Then end function
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
30. How does all this work ?
Since all classes inherit (directly or indirectly) from our BaseClass:
All have common infrastructure elements.
Logging, Persistence, Error Trapping, Configuration.
All defined in one single place.
All new classes can then focus on business logic.
31. Late Binding
Late Binding is a method where the type of an object is decided at
Run-Time.
In LotusScript this is normally achieved using the Variant data type
This may be useful where you have to perform the same operation
on number of objects of roughly the same type.
32. Late Binding Example:
' calling code. ' calling code.
dim dc as NotesDocumentCollection dim vLookup as NotesView
Set dc = dbThis.UnprocessedDocuments Set vLookup = dbThis.GetView(“($All)”)
Call ProcessDocs(dc) Call ProcessDocs(vLookup)
Function ProcessDocs(coll as Variant) as integer
dim doc as NotesDocument
Set doc = coll.getFirstDocument
While (not doc is nothing)
‘ Do something with the document
set doc = coll.getNextDocument(doc)
wend
end function
33. Late Binding Summary
Late Binding in LotusScript:
Uses Variants.
Relies on the SIGNATURE of the passed object to work, not its type.
(Other languages would force you to have a common inheritance point)
If that signature is not available, this results in a Run-time error:
So – more testing!
Very useful for “framework” processing code
A framework which will process objects exposing a common set of methods or
properties.
34. Architecturally:
Collect data together in meaningful small objects
Person, Purchase Orders, etc.
Use collection objects to group these small objects
Use generic classes to perform business operations on these
collections.
Write out the results at the end.
Good “defensive coding”.
35. Lets put all this together:
Our application compares two Notes Directories
Identifies people who are not in both databases
The Application:
1. Reads in all person documents from both directories into PersonClass objects.
2. Compares the list of PersonClass objects in both directions.
3. Creates a list of PersonClass objects that is of “interest”.
4. Writes these out to the local database for further processing.
This would be difficult to do using NotesDocuments and Arrays.
36. Demo Application
Demonstration of Advanced Object Orientated Techniques.
38. Editing Code
All Class definitions are placed in the Declarations Section
So the left-hand LotusScript Editor is useless.
Ouch!
TeamStudio to the Rescue!
http://www.teamstudio.com/support/scriptbrowser.html
Download the Class Browser.
Its Free!
Allows you to see the structure, and jump to any piece of code.
Many thanks to Craig Schumann of TeamStudio for this.
39. Editing Code
This is a screenshot
From a 400+ Script Library
database.
625 LotusScript Classes.
130,000 lines of code.
40. “Error loading USE or USELSX ” Or “Type Mismatch in %F”
This indicates that some parent class in the inheritance tree has
changed its public signature.
All dependant classes need to be recompiled.
“Tools, Recompile All LotusScript” is your friend.
This is not restricted to LotusScript
However, other IDE’s – Eclipse, RAD – will recompile all other dependant code
automatically.
41. Memory Usage:
Its very tempting to store NotesDocuments within Objects
However, this will use a lot of memory.
This will hold a lot of documents open on the server.
If you need to perform comparisons on large numbers of
documents:
1. Read the relevant parts of the document into an object.
2. Store the document NoteID or UNID.
3. Close the document.
4. Perform the comparison.
5. If you need to return to the document, open by NoteID or UNID.
Performance wise, this is very quick.
42. Class Loading Performance
As the number of dependant classes in a system starts to exceed 20
or 30, the load-time for any system which incorporates these
classes climbs exponentially.
Example. 120+ classes – 145 seconds to load!
The workaround is to use Dynamic Loading.
Dyamic loading allows you to load a class at run-time based on data, instead of
using the “Use <classLibrary>” definition.
It means that all classes are now Variants, and late-bound - More run-time
errors.
outlined in Redbook: “Performance Considerations for Domino Applications”
SG24-5602
Buried in Appendix B, Page 243
43. Dynamic Loading: ClassFactory
Class PersonClassFactory The ‘Factory’ Version of this class exists only
Public Function produce As Variant to create a new instance of the main class
Set produce = New PersonClass()
End Function
End Class
There are no constructor arguments
Class PersonClass being passed to class ‘PersonClass’. This
… will have to be changed if you choose to
End class add constructor arguments.
44. Dynamic Loading Example: CreateOtherClass
Private P as variant ‘ This HAS to be global!
Function createOtherClass (_
scriptName as String, _
className as String) as variant
This string contains
Dim exString as String LotusScript code!
exString = | Use “| & scriptName & |”
sub initialize
Set P = new | & className & |Factory &
end sub |
Execute exString ‘ Now run the code in exString
Set createOtherClass = P.produce()
End sub
45. Dynamic Loading Example: Execution
MyClass now contains an
Sub DynamicLoadingExample instance of Class “PersonClass”
from script library
dim myClass as variant “Class:PersonClass”
set myClass = createotherClass(“class:PersonClass”,“PersonClass”)
End sub
47. Summary
Object Orientated Programming in LotusScript:
Is easy.
Allows far more code reuse.
Allows you to focus on the design.
Developing Large Systems using Object Orientated Techniques
Is different.
Is far simpler.
Allows much more code re-use.
Allows you to write more consistent, more robust code.
Example: Our product:
Has over 130,000 lines of LotusScript.
Supports 40+ transactions.
Supports multi-platform, multi-version transactions.
Would be impossible to write without OO techniques.
48. Some Resources
Notes Designer help: look for "class statement", "custom classes",
"derived classes" ... and more
LotusScript Programmer's Guide, Developer Works
http://www-10.lotus.com/ldd/notesua.nsf)
Article on Developer Works (Archive of Iris Today):
Bruce Perry: Using the object oriented features of LotusScript (Oct. 1,
2001)
http://www-128.ibm.com/developerworks/lotus/library/ls-object_oriented_LotusScript/
Article "Creating Custom Classes in LS" by Johan Känngård
http://dev.kanngard.net/dev/home.nsf/ArticlesByTitle/LSClass.html
Teamstudio ScriptBrowser: http://blogs.teamstudio.com
49. Related Sessions at Lotusphere 2007
BP507 Leveraging the Power of Object Oriented Programming in
LotusScript
Jens-B Augustini & Bill Buchan
AD506 Intermediate LotusScript
John Dillon
BP308 Leverage DXL and OOP to Build Powerful Tools
Mikkel Heisterberg
AD504 What's New in the IBM Lotus Domino Objects?
James Cooper
51. Questions and Answers
Limited Time for Questions
I’m available in the speaker room immediately after this session.
This was BP301 – Advanced Object Oriented Programming for
LotusScript
I am Bill Buchan:
http://www.billbuchan.com
http://www.hadsl.com
Remember to fill in your Evaluations.
This is how YOU influence Lotusphere 2008!