LotusUserGroup.org Developer Tips Newsletter - October 2006

**************************************************************
*********** DEVELOPER TIPS NEWSLETTER ***************
Issue #13, October 2006 PRESENTED BY LOTUSUSERGROUP.ORG
**************************************************************
IN THIS ISSUE
* Introduction - I Made My Deadline This Time!
* A Domino Developer Looks At Eclipse - The Workbench...
* From the "Undocumented" newsdesk.
* Who Makes Out Better With New R7 Features?
* Reviewing The Bookshelf - The User Is Always Right
* Events for Developers

Newsletter archive available at
http://www.lotususergroup.org/submissions.nsf/news?openform
**************************************************************

Introduction - I Made My Deadline This Time!
By Thomas "Duffbert" Duff

Welcome to the October issue of the LotusUserGroup.org Developer newsletter. As I write this introduction, I'm recovering from some surgery I had earlier in the week. It's amazing what forced couch time will do for making sure you get your Eclipse article delivered on time, thereby making sure your co-editor has to find something or someone else to pick on.

In this month's issue, we take the next step down the Eclipse-as-Java-IDE road for you Domino developers. I explain what each of the main parts of the Workbench do, and then we write the traditional "Hello World" program in Java using Eclipse to show how easy it is to get started. I also cover a book called "The User Is Always Right", which explains the use of personas in your application development efforts. An interesting concept that helps break up log jams of what should and shouldn't appear in your application.

And as usual, I continue to learn new stuff from Jess this month. In "Who Makes Out Better With R7 Changes", she pits developers against users to see which group benefits the most from the new features delivered in R7. The answer wasn't what I was expecting. She also pulls out a couple of gems for the "From The Undocumented News Desk" article. I didn't know about either of these "features", and I already know of a couple of things I want to try when I log back into work.

I'd try and continue on with something profound and/or witty in this introduction, but I'm afraid the effects of the painkillers might start to show through and cause me to say something I'd have to live down at Lotusphere 2007. So until next month, I bid you farewell.

And as always, if you have any ideas or topics you'd like covered in this newsletter, please send me an email at duffbert@gmail.com. Jess can be contacted at jess42@gmail.com.

**************************************************************

A Domino Developer Looks At Eclipse - The Workbench...
By Thomas "Duffbert" Duff

Sorry for the brief hiatus from this series last month. My schedule was "non-conducive" to meeting the deadline for the newsletter, so I was flaky. But I'm back now, so the series continues.

The Workbench

When you're building a program in Eclipse, you'll be living in the Workbench. This is the equivalent to what we in the Domino world know as Designer. And actually, there's quite a bit of similarity in the layout. Figure 1 http://lotususergroup.org/glug.nsf/workbenchparts.jpg shows what a Workbench would look like for a simple Java program. There are five important areas to look for:

Perspective - This area shows what perspective you're currently viewing. A perspective is a group of views, editors, outlines, etc. that are tailored for a particular task (Java program, web project, etc.)

Package Explorer - This view shows all the components in your project, such as the package, the program(s), and any included libraries. You can think of it as the left side of the Designer screen that lists all the components of your Notes application.

Editor - This is where you write your code and design your page. It changes based on what type of project you're working on. It's the same as your Designer client's area for building your forms combined with the coding area at the bottom.

Outline View - This breaks out the particular methods and such that are part of your program. It makes it very easy to jump to particular areas of your program by simply clicking on the method you need to get to.

Task and Console Views - This is the "catch-all" area of the Workbench that shows your compile errors, any JavaDoc information that's part of your program, output generated by the program, etc. This area can change quite a bit depending on what perspective you're in.

As you can see, it's not radically different than what we're used to working with in Domino Designer. What's even better is that this user interface stays the same regardless of what you're using Eclipse for! Once you learn the basic layout and functionality of the tool, you can take that knowledge and apply it to other development efforts, be it Java, web page development, or any other plug-in environment you want to use. That's a great payback for your learning time.




Your First Program

No tutorial or series is complete without the use of the "Hello World" programming example. I'll continue on with that tradition to show you how to build your first Java program in Eclipse.

After launching Eclipse and going to the Workbench, you can start building your program by using the menu selection of File > New > Project. This launches a wizard that allows you to build the proper project layout automatically. A "project" in Eclipse isn't something that's a programming standard or anything. It's just a logical way to group all the components of an application you're currently building. Think of it as a high-level file folder containing everything related to your program. For our purposes, we're going to choose Java Project as the wizard option. After clicking Next, you'll be asked for a Project name. In this case, I'm going to call our project "HelloWorld". If you wanted to fine-tune your project, you could click Next and add more details, but the basic options are fine for us. Click Finish and Eclipse will build the project in the Package Explorer area.

Congratulations... You've just created your first project! Aren't wizards grand? :)

Now we'll create our HelloWorld java program. In the Package Explorer, click the HelloWorld project name so that it's the highlighted entry. Then use the menu selection of File > New > Class to start the wizard to build the program. The wizard that launches is tuned specfically for Java programs since that's the project option we chose. That's the beauty of perspectives.

Figure 2 http://lotususergroup.org/glug.nsf/javawizard.jpg shows how I completed the wizard. I gave the program a name of HelloWorld, checked that I wanted the public status void main method to be generated, and that comments should be generated. Again, there are many more options you can choose for more complex programs, but this is a basic program we're building. When you click finish, you'll end up with the same program layout I showed in Figure 1.

Congratulations again...you've built your first program!

At this point, you have a program that will compile and run. It won't do anything, but it will compile and run. Let's add a line of code that will allow the "Hello World" message to print out... Add the following line of code after the public static void main line:

System.out.println("Hello World!");

This line will cause the program to print out the phrase "Hello World" to the console area. To compile the program, all you need to do is save it (menu File > Save). The compile takes place automatically. Any errors you have will show up in the Task and Console view at the bottom of the Workbench. If your compile is clean, then you can run your program by using the menu command Run > Run. When your program runs, a new tab will be added to the Task and Console area at the bottom of the Workbench. The Console tab appears, grabs the focus, and shows the phrase "Hello World!".

In short order, you've built a project, built your first program, compiled the program, and ran it. Pretty easy, huh?

Obviously, we have just barely scratched the surface of the power of Eclipse. Feel free to grab a Java book and use Eclipse to enter some of the programs. It doesn't take long to get comfortable with the layout and menu options, and it will provide you with the level of comfort you'll need going forward .

Next month, I'm going to take the next step of using Eclipse to build a Java agent that can be used in your Domino application. Using the Eclipse IDE for Java coding is far better than Designer's Java IDE, and the integration is getting easier.

Until then, have fun experimenting with Eclipse. Feel free to email me with any questions you might have. The address, as always, is duffbert@gmail.com.


**************************************************************

From the "Undocumented" newsdesk...
By Jess Stratton

There's a couple of methods and keywords that are pretty darned cool, and have been around since R6. You won't find them in the Help File though. Don't even bother looking. They aren't there. Sigh, no, a full-text search won't help you either! Now a Google search, on the other hand...

NotesUIDocument ModifiedSinceSaved property

Many times, code calls for finding out if a document is "dirty", that is, has it been changed since it was last saved? You can use SaveOptions fields, you can prompt the user, there's lots of ways to go about doing this.

But there is another alternative. It's called the ModifiedSinceSaved property, and its part of the NotesUIDocument class. It was officially "unofficial" in R6. However, since R7, it's actually been part of the formal code, and was accidentally omitted from the Help file.

Usage: If a document is in Edit mode and open in the UI, the property has a value of True if the document has been modified, and False if it hasn't.

If uidoc.ModifiedSinceSaved Then
...
Else
....

NoPersist option in SetProfileField/GetProfileField

Stop me if you've heard this one:
@SetProfileField([NoPersist];"Value to store";@Username)

This is a neat flag used to set variables in a virtual profile document - it doesn't really exist. It's kind of like an environment variable, except instead of writing to Notes.ini, you're writing to a temporary client session cache.

This only works in the UI between windows in the same database for the life of the current session. Each database has its own NoPersist cache on the Notes client, so unlike environment variables, this will only work in the same database.

Enjoy, who knows until next month, when they very well may show up in the Help File. We'll all wait and see!

**************************************************************

Who Makes Out Better With New R7 Features?
By Jess Stratton

It's time for a little game. Out of users and developers, who benefits the most from all the great new features in R7? This is a fun (and completely facetious) way to let everyone know the cool changes in R7.

Scoring qualifiers are of ease of use, daily use, greater flexibility, and greater productivity. I'll add up the points, and at the end we'll see who made out the best!

** The new Rich Text Lite field type **
This is a new field type in R7 that contains a down arrow, and the user can quickly pick ONE field type to insert in, whether it be a graphic, or an attachment, or text. Now users will know visually that this is a field that can contain extra "stuff". Developers will enjoy a nice earned break from having to write on the form, "Attachments OK" after each field of type Rich Text!

Rich Text Lite: Users +5, Developers +1

** "Input enabled" field event:
This is a new field event in which a formula can specify if the field is editable or not. The only caveat being the field must be native OS style, this otherwise removes about twenty minute's energy spent creating two fields with Hide/When formulas and then putting that in a temporary field. Sadly, this will go unnoticed to the end user, save for the developer running around the office shouting weirdly, "No more hide whens! No more hide whens!"

Input enabled field event: Users +0, Developers +6

** DB2-enabled databases **
In R7, DB2 is now supported. Not only is it possible to connect to a DB2 database, but Domino also stores Notes data in DB2, which are accessible from special views via SQL statements. Users will enjoy more flexible databases that can contain information from their iSeries applications. Developers, the world is your oyster now! Connect. Program. Sync. Enjoy.

DB2-enabled databases: Users +4, Developers -5 for more work! Just kidding, +4

** Shared Columns **
First developers could share fields, and then they could share actions. However, it still brought them to early arthritic conditions and repetitive stress disorder from creating columns and setting the properties on all those views. Fortunately, R7 came to the rescue. Create a column once, and reuse it again and again. Users have their uniform look and feel, and they get their database faster, to boot!

Shared columns: Users +1, Developers +5

** Agent Profiling **
In R7, developers can add profiling to backend agents to identity performance bottlenecks that would normally otherwise go untraceable. This was a tough one, but I think in the end, the preponderance of the benefit goes to the user. Ultimately a faster agent means a faster application, which means faster access to those that will ultimately be *using* the application. Developers will finally enjoy an easy method to understand the time-honored question: which one is faster, GetNthDocument, or GetNextDocument?

Agent profiling: Users +5, Developers +1, Your Boss: +10 for not having to see you on the LDD forums asking which is faster, GetNthDocument or GetNextDocument?

** Right-Mouse Click Actions **
Finally! In R7, on any shared action, developers can include the action in the right-mouse click menu. This is a huge plus for The Society of Right-Mouse Advocates, who have been trying to get this functionality for years.

Right-mouse click actions: Users +1, Developers +3 (we'll probably use it more than they will!)

** AutoSave **
It's great that the escape key will close a window, or even a double-right click, but sometimes it's just a little too easy to close a window. Well, now there's Autosave to the rescue. While users can specify to use Autosave or not, the database must be Autosave-enabled first.

Autosave: Users +5, Developers 0

Ladies and Gentlemen, it's time for the results!
Users: 21, Developers 20 (Boss 10)

The users win! The users win! As I've said before, in a weird cosmic way, this is as it should be. I actually had no idea while I was doing it who was doing better in the tallies, by the way.
Sadly I'm a little bummed that I'm a slacker and wrote this article at the last minute. I think this would have made for a fun Lotusphere presentation, except I could pit the Admins, Developers and Users against each other in the new features. Hmmmmmm... who would make out the best? What do you think?

**************************************************************

Reviewing The Bookshelf - The User Is Always Right
By Thomas "Duffbert" Duff

The User Is Always Right - A Practical Guide to Creating and Using Personas for the Web
Steve Mulder with Ziv Yaar
293 pages
New Riders
ISBN: 0321434536

When creating a web site or a Notes application, it's very easy to fall into the trap of designing it for yourself. Unfortunately, you're not the typical user in most cases, nor are you the intended audience. You can avoid this problem with the use of "personas". This subject is covered in the book The User Is Always Right - A Practical Guide to Creating and Using Personas for the Web (http://www.amazon.com/exec/obidos/ASIN/0321434536/duffbertsrand-20) by Steve Mulder with Ziv Yaar.

Table of Contents:
1. Putting the User Back in User-Centered Designated
2. Meet the Personas
3. Approaches to Creating Personas
4. Conducting Qualitative User Research
5. Conducting Quantitative User Research
6. Generating Persona Segmentation
7. Making Personas Real
8. Keeping Personas Alive
9. Directing Business Strategy
10. Scoping Features and Functionality
11. Guiding Structure, Content, and Design
12. Measuring Success
Index

User-driven design means that you focus on what the user needs in a system instead of designing features because they're "cool". Personas are imaginary users of your system that you keep in mind while designing how the application will work. But it's much more than just picking a name like Bob and then coding away...

This book goes into the process of interviewing the user base of your proposed application, determining the needs and abilities of that base. A system that is to be used by computer-savvy accountants will not have the same look and feel as a system that is intended for your grandmother. By conducting these interviews and consolidating the results, the designer can get a good idea as to what a typical user will look like. That information is then used to create a number of personas, or fictitious people who will be the target audience. These personas come complete with names, pictures, and a background. Then instead of building features based on how you feel about them, you look at the feature through the eyes of "Bob", based on his attitudes, experience, and personality. It's like having a user available to you 24 hours a day, 7 days a week.

The User Is Always Right takes you through the steps necessary to understand the audience for your system, as well as how to make that audience "real" in terms of individual people. The authors do a nice job in making the process clear and understandable, and by the end you can start building your imaginary friends with confidence. The process outlined here is one that you wouldn't necessarily use for every project, as you could spend days gathering and distilling the data you collect. But the concepts they present, once understood, will allow you to build your "Bob"s even with small systems. Then armed with that knowledge, you can anticipate answers to the question "what would Bob do?"

This technique is being used for the Hannover version of IBM Lotus Notes. Rather than allowing designers to do things that are cool to them, all the design features are being run through persona users to be sure that everything actually serves a purpose and works well for everyone. This book will definitely help you understand how important this is to designing a version of Notes that won't be hounded by complaints that the user interface is non-intuitive and unproductive.

So... If you are tired of designing really cool systems (to you) that don't ever seem to get used, it may be because you missed the real users. Give the persona technique a try, and I think you'll be pleasantly surprised at how it affects your development.

Besides, how else could you actually be commended for inviting and talking to imaginary friends?

**************************************************************

EVENTRS FOR DEVELOPERS
Please be sure to visit the events listings on LotusUserGroup.org for the most recent listings of upcoming Lotus focused events. Events are listed on the home page at http://www.LotusUserGroup.org

**************************************************************
**************************************************************

MEMBERSHIP AND SITE INFORMATION
You are receiving this email as benefit of membership as a registered user of LotusUserGroup.org. This newsletter mails monthly on the first Tuesday of each month. Let us know what we can do to help you achieve your goals. Drop us a line at mailto:UserGroupInfo@LotusUserGroup.org or choose Contact Us from the home page at http://www.lotususergroup.org.

You should have received an email with your username and password. If you inadvertently deleted your email, just let us know by replying to this message requesting your user information.

Your username is your first name, a space, your middle initial (if you registered with one), a space, and your last name. If your password was generated for you by the system and you wish to change it, just access the Manage My Account link from the left-hand menu on the LotusUserGroup.org home page.

If you no longer wish to receive the monthly Developer newsletter, edit your profile by logging in at LotusUserGroup.org and selecting Manage My Account. You may also reply to this email or notify us at usergroupinfo@lotuusergroup.org. You can also reach us at 781-751-8750 or at 990 Washington St., Suite 308, Dedham, MA 02026.
**************************************************************
**************************************************************
Copyright 2006 LotusUserGroup.org, Wellesley Information Services
990 Washington St., Suite 308, Dedham, MA 02026.
**************************************************************

This newsletter is a benefit of being a member of LotusUserGroup.org. You may send email to UserGroupInfo@LotusUserGroup.org for any customer service needs.





Site hosted by


Copyright © Wellesley Information Services and LotusUserGroup. All rights reserved. Email: usergroupinfo@lotususergroup.org
LotusUserGroup, 20 Carematrix Drive, Dedham, MA 02026, USA.
Sales and Customer Service: 1.781.751.8755