Top Tips Every Notes Developer Needs To Know


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Top Tips Every Notes Developer Needs To Know

  1. 1. JMP102 The Top Things All New IBM LotusDomino Developers Need To KnowKathy Brown | Application DeveloperThomas “Duffbert” Duff | Application Developer
  2. 2. Agenda● Coding Best Practices● Application Architecture● Languages and Features● Learning● User Interface● Everything Else 2
  3. 3. For the love of all that is holy... Option Declare3
  4. 4. OR prevents...4
  5. 5. 5
  6. 6. Comment Your Code(even the Matrix will have errors somewhere...) 6
  7. 7. Better than nothing... ... Better still
  8. 8. File > Preferences > Domino Designer > LotusScript Editor > Comment Templates
  9. 9. Error Handling... do it!9
  10. 10. Example #110
  11. 11. Option PublicOption DeclareUse "OpenLogFunctions"Sub Initialize Example #2 OpenLog Dim session As New NotesSession Dim dbThis As NotesDatabase Dim viewThis As NotesView Dim docThis As NotesDocument Dim dtCutoffDate As NotesDateTime Dim varCutoffDate As Variant On Error Goto logError Call LogEvent("Purge Older Than 4 Months Agent Started", SEVERITY_LOW, Nothing) <insert your agent code here> Call LogEvent("Purge Older Than 4 Months Agent Ended", SEVERITY_LOW, Nothing) Exit SublogError: Call LogError Exit SubEnd Sub 11
  12. 12. All it takes are these two libraries to give you what you see below...12
  13. 13. Thank you, Julian Robichaux, for OpenLog 13
  14. 14. No Hard Coding...EVER! 14
  15. 15. Users never change their minds, right? Can you change “Mommie Dearest” to “Mommy Dearest” Jones made partner. in all field options? We’ve changed the company name. Again. 15
  16. 16. Good code can be re-used 16
  17. 17. Hard coding Server Names -Its the opposite of that sports slogan,Just Dont Do It. (well explain why later...) 17
  18. 18. Test, Test, Test! 18
  19. 19. ● Things to consider: Print statements in LotusScript @Prompt statements in Formula alert() in JavaScript LotusScript debugger (more to follow on that) Dont test your own code Test edge cases Load test... with more than 20 documents! Unfortunately, no xUnit for Notes... 19
  20. 20. Use the LotusScript Debugger (it is your friend!) 20
  21. 21. Agenda● Coding Best Practices● Application Architecture● Languages and Features● Learning● User Interface● Everything Else 21
  22. 22. Plan for Replication, Clustering, and Save Conflicts 22
  23. 23. Server names? Local replicas? Sequential numbering? (Just say no!)23
  24. 24. Understand Business Requirements 24
  25. 25. Things to Consider● Purpose of project● Who are the key players of the project?● Who are the end users?● Length of time given to complete project
  26. 26. Agenda● Coding Best Practices● Application Architecture● Languages and Features● Learning● User Interface● Everything Else 27
  27. 27. n:=0;@While (n > 1; Im:=gonna give you up) 28
  28. 28. VS. VS. No Thanks!29
  29. 29. ● You can use @Formula in Lotusscript with Evaluate For each document in a Notes database, use a Notes macro to compute the average for a list of numeric entries in the NumberList field. Evaluate returns a Variant, and Notes macros return an array. In this case, the array contains only 1 element (element 0). For more info, see the Notes documentation. Sub Click(Source As Button) The macro text must be known at compile time.Remember Const NotesMacro$ = "@Sum(NumberList) / @Elements(NumberList)"this line... Dim result As Variant, j As Integer Dim db As New NotesDatabase("", "MYSALES.NSF") Dim dc As NotesDocumentCollection Dim doc As NotesDocument Set dc = db.AllDocuments For j% = 1 To dc.Count Set doc = dc.GetNthDocument(j%) result = Evaluate(NotesMacro$, doc) MessageBox("Average is " & result(0)) Next End Sub ● And you can use @Formula in Xpages with SSJS! 30
  30. 30. LotusScript Is Not Scary 31
  31. 31. 32
  32. 32. DXL Is Not Scary 33
  33. 33. DXL lets you view data and design elements in XML format. You can export, transform, and import that XML into and out of your Notes database... Imagine changing all the occurrences of a font name or some other design element by doing a Find/Replace!But be careful!DXL does nothave 100%fidelity, so youcould loseimportant datafrom yourdatab... 34
  34. 34. Layers AreNot Scary 35
  35. 35. 36
  36. 36. Agenda● Coding Best Practices● Application Architecture● Languages and Features● Learning● User Interface● Everything Else 37
  37. 37. Help! I Need Somebody! HELP! 38
  38. 38. Help! I Need Somebody!It doesnt matter how many years youve been developing...F1 Help from Domino Designer is your best-est friend... 39
  39. 39. Help Is Just a Click Away!40
  40. 40. Resources:PlanetLotus - http://www.planetlotus.orgOpenNTF – http://www.openntf.orgTwitter - http://www.twitter.comDeveloperWorks - Designer Wiki - Scott Domino Supersearch - Discussion Forums - KnowledgeBase - ASK! 41
  41. 41. 42
  42. 42. Agenda● Coding Best Practices● Application Architecture● Languages and Features● Learning● User Interface● Everything Else 43
  43. 43. Its Important44
  44. 44. Important: Developers (plumbers) generally arent very good designers (painters) 45
  45. 45. So Easy, Even a N00b Can Do It! 46
  46. 46. Low Fidelity Prototyping 48
  47. 47. Agenda● Coding Best Practices● Application Architecture● Languages and Features● Learning● User Interface● Everything Else 50
  48. 48. Basic UnderstandingOf Admin Concepts 51
  49. 49. 52
  50. 50. Document Everything 53
  51. 51.  Document the business requirements Document changes to the business requirements Document your proposed solution to the businessrequirements Document acceptance/rejection from both you andthe client of proposed solution Document time projections Document changes to requirements made after timeprojections Document anything and everything you can think of 54
  52. 52. Change Control Process 55
  53. 53. Security Through not security 56
  54. 54. You may be familiar with the ACL,but keep in mind that many designelements have security too. 57
  55. 55. Reader Fields A Double-Edged Sword 58
  56. 56. Readers fields can... Negatively affectRestrict users access performanceSpan more than one field
  57. 57. Gotchas... Watch name formats Dont let users modifyAlways have a back door
  58. 58. Understand Basic Performance Tuning 61
  59. 59. ● SO many things you can look for...●● GetNthDocument vs GetNextDocument●● NoCache on @DbLookups●● AutoUpdate on views●● Repeated @DbLookups●● Refreshing form on each field●● View indexing●● @Today in views (@Now also)●● @IsResponseDoc vs. @AllDescendents 62
  60. 60. Talk to Papa 63
  61. 61. Question and Answer Time!Contact Information:Kathy Brown - kathysrunningnotes@gmail.comBlog: Running Notes - http://www.runningnotes.netTwitter: kjbrown13Thomas “Duffbert” Duff - duffbert@gmail.comBlog: Duffberts Random Musings - http://www.duffbert.comTwitter: duffbertDont forget to turn in your session evaluations! This was session JMP102 – Top Things AllNew Notes and Domino Developers Need To Know
  62. 62. ● Legal Disclaimer ● © IBM Corporation 2009. All Rights Reserved.● The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained in this publication, it is provided ASIS without warranty of any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are subject to change by IBM without notice. IBM shall not be responsible forany damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing contained in this publication is intended to, nor shall have the effect of, creating any warranties orrepresentations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software.● References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in thispresentation may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. Nothingcontained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results.●Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending uponmany factors, including considerations such as the amount of multiprogramming in the users job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can begiven that an individual user will achieve results similar to those stated here.●IBM, the IBM logo, Lotus, Lotus Notes, Notes, Domino, Quickr, Sametime, WebSphere, UC2, PartnerWorld and Lotusphere are trademarks of International Business Machines Corporation in the United States, othercountries, or both. Unyte is a trademark of WebDialogs, Inc., in the United States, other countries, or both.● Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.● Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.● UNIX is a registered trademark of The Open Group in the United States and other countries.● Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.● Other company, product, or service names may be trademarks or service marks of others. 65