Boost PC performance: How more available memory can improve productivity
Presentatie xPage & Beer
1. Be smart work together
Coding Java for xPage Developers
Woensdag 2 Oktober 2013
Jeroen Somhorst
j.somhorst@acuity.nl
http://www.jeroensomhorst.eu
2. Be smart work together
Coding Java for xPage Developers
• Inleiding
• Functions
• Classes
• Code comments
• Error Handling
• The OpenNTF Domino Api Project to the rescue
3. Be smart work together
Coding Java for xPage Developers
• Who is that guy?
• Waar gaan we het over hebben?
4. Be smart work together
Functions
• Functienamen moeten vertellen wat de functie doet
• Do one thing, they should do it well and they should do it only
• Never use an input parameter as an output!
• Flag parameters
5. Be smart work together
Classes
• Kleine klassen maakt blije leerlingen
• SRP principle
• Kleine klassen maakt blije leerlingen
• SRP principle
– Houd rekening met verandering!
6. Be smart work together
Comments
• Comments make things worse
• Explain yourself in code not in comments
7. Be smart work together
Error handling
• Write your try/catch first!
• Use of Finally
• Use exceptions
8. Be smart work together
The OpenNTF Domino Api Project to the rescue!
• Wat is de OpenNTF Domino API?
• Iterators
– (.hasNext(), .next());
• No recycle!
• No default try/catch for exceptions
9. Be smart work together
The OpenNTF Domino Api Project to the rescue!
• Get from http://bit.ly/196Cect
• Copy .jar files to designer jvm/lib/ext
• Copy jar files to domino jvm/lib/ext
• Create update site for osgi domino
• Added entry to xsp.properties on domino server to use
session/database classes from api
(org.openntf.domino.xsp=godmode)
10. Be smart work together
The OpenNTF Domino Api Project to the rescue!
• Get from http://bit.ly/196Cect
• Copy .jar files to designer jvm/lib/ext
• Copy jar files to domino jvm/lib/ext
• Create update site for osgi domino
• Added entry to xsp.properties on domino server to use
session/database classes from api
(org.openntf.domino.xsp=godmode)