Uklug2009 Hairy Bikers Cookbook

30
The Hairy Bikers Domino Cookbook Presenter: Bill Buchan & Steve McDonagh Company: hadsl & AVX

description

The 'Hairy Bikers Domino Cookbook' presentation from the UK LUG conference 2009, hosted by Steve McDonagh, and Bill Buchan

Transcript of Uklug2009 Hairy Bikers Cookbook

Page 1: Uklug2009   Hairy Bikers Cookbook

The Hairy Bikers Domino Cookbook

Presenter: Bill Buchan & Steve McDonaghCompany: hadsl & AVX

Page 2: Uklug2009   Hairy Bikers Cookbook

The Hairy Bikers ?

• “The Hairy Bikers” are two hairy bikers who do cooking–Simon King & Dave Myers–Have a BBC Series

• Their web site is at:–http://hairybikers.com

• Steve and I are both bikers–And he can cook

• So we thought....

Page 3: Uklug2009   Hairy Bikers Cookbook

Programming is like Cooking

• Programming is like cooking

–You get a recipe to help you start–As you get better, you can adapt it–We’ll give you a short tutorial on each item

• But... You know all about Domino Programming

Page 4: Uklug2009   Hairy Bikers Cookbook

This is not...

• This is NOT about Domino Programming• This is about interfacing Domino to different systems• Remember:

–A good corporate programmer does not developfrom scratch

–A good corporate developer is there to join up components in order to deliver results

–Sometimes, the components are outside Domino–Like a hairy biker, we knock stuff out using the stuff we find

Page 5: Uklug2009   Hairy Bikers Cookbook

Remember:

• Whilst the business might love Domino–Other parts of the business use different tools.

• Its part of our job to make it easy –For those other parts to see our data–For our applications to use other data

• Not only does that make us gods in our world–It makes us good corporate programmers to other teams

• Job Security....

Page 6: Uklug2009   Hairy Bikers Cookbook

So what we going to cover?

• The worlds simplest Lotus Notes Application–A wee contact database

• Then we access it via a:–Web service–Ajax front end–BlackBerry SmartPhone–Flex Front End–.Net Visual Basic Service

Page 7: Uklug2009   Hairy Bikers Cookbook

We’re focusing on..

• We’re focusing on–The pros and cons for each platform–Hacking Developing each solution–Debugging each solution

• We’re not really interested in the Domino application - you know all about those

• We’re not delivering production quality code here–Thats your homework

Page 8: Uklug2009   Hairy Bikers Cookbook

The Application is:

• The Application is:–Very simple - single view and Form–No complex code, validation, error checking

• Remember, –The application isnt the point of this presentation–The point is how it interfaces with other systems

Page 9: Uklug2009   Hairy Bikers Cookbook

The Hairy Bikers Example Db

Page 10: Uklug2009   Hairy Bikers Cookbook

The Domino Application

Page 11: Uklug2009   Hairy Bikers Cookbook

Serving Web Services to others...

• Ingredients:–Domino 7.x or above–Lotusscript–Soap UI (http://soapui.org)–Domino Designer 7 or above

• Level: Simple

Page 12: Uklug2009   Hairy Bikers Cookbook

How to create a Web Service...

• Create a LotusScript-based web service in Domino Designer

• Name the class which exposes your methods• Save the class• You can access the web service using:

–http://<server>/<database.nsf>/WebServiceName?WSDL–In any browser

• You can now test the web service using SoapUI• Demo!

Page 13: Uklug2009   Hairy Bikers Cookbook

Ajax Applications

• Ingredients:–Domino 5.x or above–Lotusscript–Domino Designer 5 or above

• Level: Simple (if you know javascript)

Page 14: Uklug2009   Hairy Bikers Cookbook

How to create an Ajax application

• You need to choose a Ajax Framework:–Dojo is included in Domino and used within iNotes

• Attach them to the application–Simplest is to embed in the application

• Write forms and views using Javascript for function and CSS for display

• Test, test, test, and test again–In all browsers...

• Demo!

Page 15: Uklug2009   Hairy Bikers Cookbook

Confirmation

Page 16: Uklug2009   Hairy Bikers Cookbook

SoapUI and the Web Service

• This shows the ‘GetBuddyNames’ Call. –The SOAP web service call on the left, results on the right

Page 17: Uklug2009   Hairy Bikers Cookbook

SoapUI and the Web Service

• This shows the ‘GetBuddy’ Call. –The SOAP web service call on the left, results on the right

Page 18: Uklug2009   Hairy Bikers Cookbook

Flex Applications

• Ingredients:–Adobe Flex Builder v3 or above (adobe.com)–Lotusscript–Domino Designer 7 or above

• Level: Medium (if you know java)

Page 19: Uklug2009   Hairy Bikers Cookbook

How to create a Flex application

• Open up Flex Builder–Do the flex bits..

• Embed the SWF file in a page or form–Copy+paste the launch code from Flex Builder to the page

• Demo!

Page 20: Uklug2009   Hairy Bikers Cookbook

Rich Internet Applications...

• Rich Internet Applications allow the developer to have apps

A. that are connected

B. that are engaging

C. respect user adoption over technical integration

Page 21: Uklug2009   Hairy Bikers Cookbook

My experience of using RIA’s

As a corporation we needed :• Something that would give a unified corporate look and feel

• Something easily localised to 14 languages

• Something that looked and worked the same on all platforms

• Something easily deployable on all conceivable platforms

• Something that could “talk” to multiple data sources

• Something that could produce amazing results quickly

Page 22: Uklug2009   Hairy Bikers Cookbook

.Net Applications

• Ingredients:–Visual Studio 2005 or 2008–Visual Basic or C# skills

• Level: Easy (if you know lotusscript)

Page 23: Uklug2009   Hairy Bikers Cookbook

How to create an .net application

• Open up Visual Studio 2005 or 2008• Create a ‘Windows Console’ application

• On the project explorer, create a web service• Point it at our Domino web service• Wire in some code...

Page 24: Uklug2009   Hairy Bikers Cookbook

How to create a .net application• On Solution explorer, ‘Add Service Reference’

• Point it at our Domino web service:

Page 25: Uklug2009   Hairy Bikers Cookbook

How to create a .net service

• In my case, I want to create a .net v2 service, so click on Advanced,–Then click on ‘Add

Web Reference’

Page 26: Uklug2009   Hairy Bikers Cookbook

How to create a .net service

• Enter a web reference name–The click

on ‘Add Reference’

Page 27: Uklug2009   Hairy Bikers Cookbook

The .Net Code

Page 28: Uklug2009   Hairy Bikers Cookbook

Windows Services

• If you want code that will run all the time consider using a windows service:–It has a ‘sleep/wakeup’ protocol so it could poll for work on

a regular basis–If it detects work, it can then spawn worker threads to

execute this work.–Its harder to install - I used MakeMSI to make the .MSI

installer for my windows services.–If you call an authenticated web service, where do you

store the username/password ?• Clear text isnt good enough.

Page 29: Uklug2009   Hairy Bikers Cookbook

A Quick Gotcha!

• Applications built using –VS2005 want to use .Net Framework 2.5–VS2008 want to use .Net Framework 3.0 or 3.5

• Customers in general have NOT rolled out .Net Framework v3 to their clients, nor their servers

• You can target these projects to use .Net Framework v2.5 - this may make your deployment easier

Page 30: Uklug2009   Hairy Bikers Cookbook

So to round up

• Be very good at Domino• Be good at other things too• Domino is not a walled garden• Everything is a weapon