Top Tips Every Notes Developer Needs To Know

Download Top Tips Every Notes Developer Needs To Know

Post on 05-Dec-2014

498 views

Category:

Documents

4 download

Embed Size (px)

DESCRIPTION

 

TRANSCRIPT

<ul><li> 1. JMP102 The Top Things All New IBM LotusDomino Developers Need To KnowKathy Brown | Application DeveloperThomas Duffbert Duff | Application Developer </li> <li> 2. Agenda Coding Best Practices Application Architecture Languages and Features Learning User Interface Everything Else 2 </li> <li> 3. For the love of all that is holy... Option Declare3 </li> <li> 4. OR prevents...4 </li> <li> 5. 5 </li> <li> 6. Comment Your Code(even the Matrix will have errors somewhere...) 6 </li> <li> 7. Better than nothing... ... Better still </li> <li> 8. File &gt; Preferences &gt; Domino Designer &gt; LotusScript Editor &gt; Comment Templates </li> <li> 9. Error Handling... do it!9 </li> <li> 10. Example #110 </li> <li> 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) Call LogEvent("Purge Older Than 4 Months Agent Ended", SEVERITY_LOW, Nothing) Exit SublogError: Call LogError Exit SubEnd Sub 11 </li> <li> 12. All it takes are these two libraries to give you what you see below...12 </li> <li> 13. Thank you, Julian Robichaux, for OpenLoghttp://www.openntf.org/projects/pmt.nsf/ProjectLookup/OpenLog 13 </li> <li> 14. No Hard Coding...EVER! 14 </li> <li> 15. Users never change their minds, right? Can you change Mommie Dearest to Mommy Dearest Jones made partner. in all field options? Weve changed the company name. Again. 15 </li> <li> 16. Good code can be re-used 16 </li> <li> 17. Hard coding Server Names -Its the opposite of that sports slogan,Just Dont Do It. (well explain why later...) 17 </li> <li> 18. Test, Test, Test! 18 </li> <li> 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 </li> <li> 20. Use the LotusScript Debugger (it is your friend!) 20 </li> <li> 21. Agenda Coding Best Practices Application Architecture Languages and Features Learning User Interface Everything Else 21 </li> <li> 22. Plan for Replication, Clustering, and Save Conflicts 22 </li> <li> 23. Server names? Local replicas? Sequential numbering? (Just say no!)23 </li> <li> 24. Understand Business Requirements 24 </li> <li> 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 </li> <li> 26. Agenda Coding Best Practices Application Architecture Languages and Features Learning User Interface Everything Else 27 </li> <li> 27. n:=0;@While (n &gt; 1; Im:=gonna give you up) 28 </li> <li> 28. VS. VS. No Thanks!29 </li> <li> 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 " &amp; result(0)) Next End Sub And you can use @Formula in Xpages with SSJS! 30 </li> <li> 30. LotusScript Is Not Scary 31 </li> <li> 31. 32 </li> <li> 32. DXL Is Not Scary 33 </li> <li> 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 </li> <li> 34. Layers AreNot Scary 35 </li> <li> 35. 36 </li> <li> 36. Agenda Coding Best Practices Application Architecture Languages and Features Learning User Interface Everything Else 37 </li> <li> 37. Help! I Need Somebody! HELP! 38 </li> <li> 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 </li> <li> 39. Help Is Just a Click Away!40 </li> <li> 40. Resources:PlanetLotus - http://www.planetlotus.orgOpenNTF http://www.openntf.orgTwitter - http://www.twitter.comDeveloperWorks - http://www.ibm.com/developerworksDomino Designer Wiki - http://www-10.lotus.com/ldd/ddwiki.nsfMartin Scott Domino Supersearch -http://www.martinscott.com/dominosupersearch2.nsf/search?openformLotus Discussion Forums -http://www.ibm.com/developerworks/lotus/community/#publicforumsDomino KnowledgeBase - http://www-01.ibm.com/support/search.wss?rs=463&amp;tc=SSKTMJ&amp;q=&amp;loc=en-usJUST ASK! 41 </li> <li> 41. 42 </li> <li> 42. Agenda Coding Best Practices Application Architecture Languages and Features Learning User Interface Everything Else 43 </li> <li> 43. Its Important44 </li> <li> 44. Important: Developers (plumbers) generally arent very good designers (painters) 45 </li> <li> 45. So Easy, Even a N00b Can Do It! 46 </li> <li> 46. Low Fidelity Prototyping 48 </li> <li> 47. Agenda Coding Best Practices Application Architecture Languages and Features Learning User Interface Everything Else 50 </li> <li> 48. Basic UnderstandingOf Admin Concepts 51 </li> <li> 49. 52 </li> <li> 50. Document Everything 53 </li> <li> 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 </li> <li> 52. Change Control Process 55 </li> <li> 53. Security Through Obscurity...is not security 56 </li> <li> 54. You may be familiar with the ACL,but keep in mind that many designelements have security too. 57 </li> <li> 55. Reader Fields A Double-Edged Sword 58 </li> <li> 56. Readers fields can... Negatively affectRestrict...</li></ul>