Workbench Overview
Peter Komisar © Conestoga College  version 1.1  Fall / 2007

Reference:  Third Draft Document for Review, Sept. 17,2007,
SG24-7501-00 'Rational Application Developer V7 Programming
Guide'.

This is a synopsis of information found in the latter part
of the third chapter, 'Workbench setup and preferences'
found in the third draft Document for Review, dated September
17, SG24-7501-00 Rational Application Developer V7
Programming Guide. It has been prepared for private
academic purposes and is not an effort to publish the
contained material.

Anonymous quotes are assumed to be from the above
noted reference.



On opening the application you see a single
window, the welcome window. It has the
following icons.

Welcome Window Icons

Customize the Welcome Page with themes via the
customize page option.

Default Perspective

Close the Welcome page and the Default Perspective
is presented.

Workbench, Perspective, View & Editors

The term Workbench refers to the desktop development
environment. Each Workbench window of Application
Developer contains one or more perspectives. Perspectives
contain views and editors and control what appears in
certain menus and toolbars.


GUI Containment

Workbench { Perspective(s){Views, editors} }


Workspace


Starting up Application Developer you are prompted
to provide a workspace to start up.  Developers may
have many workplaces.


Example Workspace Path at Startup

c:\Documents and Settings\<user>\IBM\rationalsdp7.0\workspace

// where <user> is the Windows user ID you used to login.

The Application Developer 'workspace' is a place
that the individual developer uses to holding various
project files.

// it is not recommended that meta data such as
// configuration files be moved between workspaces



Multiple Workbenches


You can open more than one workbench on a
project to supply different perspectives. Changes
made on one bench will reflect in the other. You
cannot make a change in one workbench while a
wizard is active in another working on the same
project.

Opening Another Workbench

Window -> New Window // same perspective

By default, new perspectives are opened in the
current window. This default behavior can be
configured using:

Preference Path

 Window → Preferences → General → Perspectives

The default workspace can be started on first startup
of Application Developer by specifying the workspace
location on the local machine and selecting the check
box "Use this as the default and do not ask again".

// also via  command line specifier using -data flag


Specifying  Startup Workplace Via the Command Line


c:\Program Files\IBM\SDP70\eclipse.exe -data c:\MyWorkspace


Startup parameters



List of Startup Parameters


Application Logging

Log files help in troubleshooting when unexpected
program behavior occurs. "Application Developer
Log and Trace Analyzer implements common logging,
which enables plug-ins to log events in a common
logging log file and logging agent." There is a preference
window to configure the logging level for each of the
plug-ins. You can also set the number of days after
which archived log files will be deleted. The default
is 7 days.

Screenshot The logging preference window set to
7 days.

"Logging is turned off by default unless plug-ins
explicitly define a logging level in their plugin.xml file.
Changing the message level from NONE to any
other level will enable logging."

Log Files

The are two primary log files. They reside in the
.metadata directory of the workspace folder.

Primary Log Files
// viewable in the 'Log and Trace Analyzer'
// to do analysis, sorting, filtering and correlation.


Preferences

The workbench preferences can be modified via
Window → Preferences. Each preference has a
page, where initial options can be changed. Help
and dialog pages provide complete descriptions.


Automatic Builds


Builds in Application Developer are compilation of
Java code. They are done automatically when a
resource has been modified and saved.

The automatic build feature can be disabled, for
instance in the circumstance where a build is of no
value until a large number of changes have been
made.


Preference Path
select Windows Preferences General
Workspace clear Build automatically

// use restore defaults button to undo a change


Manual Builds  // aka a 'clean build'

Automatic build may slow down development.
In some cases forcing a build of a project or all
projects will help resolve build errors and dependency
issues.

Manual Build Steps ( since last build )
// only builds resources that have changed since the last build.


Manual Build Steps ( build all resources, even those not changed )
// The previously selected project selected by default,
// otherwise pick from list


Capabilities

Rational describe what you can do with Application
Developer as 'capabilities'. These can be enabled
or disabled.


Examples of Capabilities Not Enabled by Default


Capabilities are enabled in the following ways:
The above briefly describes two ways to enable team
support and one way to enable profiling and logging.

Screenshot 2: Show the team capability being enabled
via the human icon on the welcome page. 


File Associations


The File Associations preferences page enables
adding or removing file types recognized by the
Workbench. Editors or external programs can also
be associated with file types.


Adding a File Association

Example


IE is added to open .dll files // database definition language

Local History


A local history of files is maintained. When a file
is created or modified previous editions are saved
allowing an older version to be retrieved. Each
edition is uniquely identified by date and time. Only
files have local history. Projects and folders do not.


Preference Path

Select Window → Preferences → General →
Workspace → Local History


History Settings

// skipped instructions to compare, replace, and restore local history


Perspectives Preferences


The Perspectives preferences page governs how
perspectives are presented.

Preference Path

Select Window →Preferences → General → Perspectives

Options
// other features are listed


Web Browser Preferences


The Web browser settings select which Web
browser is the default for information display.


Preference Path

Select Window → Preferences → General → Web Browser

The default option is to use the internal Web browser.

Internet preferences

The Internet preferences have three setting types

Internet Settings
// the draft defers the reader to the help pages for first two items

Proxy settings

From within an intranet, the HTTP proxy server might be
used to cross a company firewall to get to the Internet.
To set follow the following path.

Preference Path

Select Window → Preferences → Internet → Proxy Settings

"Select 'Enable Proxy' and enter the proxy host and port.
There are additional optional settings for the use of SOCKS
and enabling proxy authentication. Click Apply and then OK."


Java Development Preferences


Application Developer provides preferences for different
programming technologies including Java, Web tools,
XML, SQL and plug-in development. This section only
covers commonly used Java development preferences.

// other preferences are treated in relevant chapters


Java Classpath Variables


Eclipse/Dev 7 supplies a series of default classpath variables
identified by variable name, avoiding direct referencing of
the local file system. This is a recommended approach when
developing with a team using multiple projects using the same
variables. In this methodology all team members are required
to set the variables required for a project. This data is then
maintained in the workspace.

Adding Variables Pointing to Other Code Libraries

You may add variables pointing to other code libraries. The
example given in the IBM draft is locations for JDBC driver
classes or locally developed code that will see reuse.


Path for Setting Classpath Variables

 Select Window → Preferences → Java → Build Path →
Classpath Variables.

"Creation, editing, or removing of variables can be performed
in this screen. Click New to add a new variable.  In the 'New
Variable Entry' dialog enter the name of the variable and
browse for the path and click OK "

Internally Set Classpath Variables That Cannot Be Changed

Appearance of Java Elements

How Java class members appear in views is configurable.


Path To Java Appearance Page


 Select Window → Preferences → Java → Appearance.

Following is a summary of appearance options.

Java Appearance Options

To change the order of the members to be displayed
in the Java viewers do the following:

Changing Order of Appearance of Java Members

Select Java → Appearance → Members Sort Order.

To specify types and packages to hide do the following:

Filtering Types & Packages

Select Java → Appearance → Type Filters

// create a new filter or add packages to the type
// filter list.
The default is to hide nothing.


Code Style and Formatting


The Workbench Java editor allows configuration
of code format and style to suit personal or team
preferences. Formatting can be applied to Java
created by wizards as well as that formed in the
editor. 


Code Style Sample

Setting Style


Select Windows → Preferences → Java → Code Style
Select the Fields row and click Edit.
In the 'Field Name Conventions dialog' enter m in the Prefix
list field and click OK.
Repeat for all the conventions defined

Coding Conventions

For the generation of setter and getter methods the
following conventions are used.

"Whenever a prefix of m followed by a capital letter is
found on an attribute, this would ignore the prefix and
generate a getter and setter without the prefix.

If the prefix is not found followed by a capitalized letter,
then the setter and getter would be generated with the
first letter capitalized followed by the rest of the name
of the attribute.


Code Style Snippet
// From IBM Rational Application Developer 7.0 Programming Guide

private String maddress;
private float m_salary;
private int zipcode;

/**
* @return the m_salary
*/
public float getM_salary() {
return m_salary;
}
/**
* @return the maddress
*/
public String getMaddress() {
return maddress;
}
/**
* @return the counter
*/
public long getCounter() {
return mCounter;
}
/**
* @return the zipcode
*/
public int getZipcode( ) {
return zipcode;
}


Checkbox Code Style Settings


The following settings are controlled by checking
checkboxes.

Checkbox Control Style Settings

- Qualify all generated field accesses with 'this.'
If selected, field accesses are always prefixed with this

-Use 'is' prefix for getters that return boolean
If selected, boolean getter methods are prefixed with is not get.

-Auto- add comments for new methods and types
If selected, new methods & types are commented

-Add '@Override' annotation for overriding methods
If selected, overriding methods include an @Override annotation.

-Exception variable name in catch blocks
Specify the exception variable name declared in catch blocks.


Formatter

The formatter preferences in Application Developer
are used to enforce the code format of the standard
defined for a team of developers.  In other words,
Java written in a developer's own style can be formatted
to the specification used by a team.

// formatting would follow testing

Three standard profiles are supplied with Application
Developer and custom profiles can be created.

Standard Built-In Profiles

Configuring the Formatter

Select Window → Preferences
→ Java → Code Style → Formatter


Other Options


Using the Formatter

In the Java editor, right-click →
Select Source → Format.

// uses rules defined in formatter preferences


Creating a User-Defined Profile


User-defined profiles would be extensions of existing
built-in profiles. If the existing profile is modified then
it is saved as a new profile.

Profiles can be exported as XML files. They contain the
standard definitions required for your project. This file
can be stored in a team repository and imported by team
members.

Summary of Profile Features
Examples  // from IBM Rational draft
Examples  // from IBM Rational draft

Examples 
// from IBM Rational draft

Maximum line width (default is 80)
Default indentation (2)


Java Editor Settings

Most options for the Java editor relate to look and
feel.

Java Editor Configurations

 Select Windows → Preferences → Java → Editor


Options Applicable to Text Editors


General → Editors →Text Editors


Main Java Editor Settings



Content Assist


Content is used in assisting a rapid error free code
development. It is triggered by Ctrl+Spacebar and
will complete a variable or method name.


Configuring  Content Assist


Select Windows → Preferences → Java →
Editor → Content Assist

Screenshot: Screenshot the Content Assist Page.


Folding

The Workbench user can collapse a method, comments,
or class into a concise single line view.

Configuring Folding

Select Windows → Preferences → Java →Editor → Folding

Mark Occurrences

This feature is used to highlight all occurrences of
a particular Java element. For instance, the selection
of a particular attribute will show in the right-hand
context bar all occurrences of that attribute in the code
being looked at.

Configuring Mark Occurrences

Select Windows → Preferences →Java → Editor
→ Mark Occurrences


Templates


A template captures frequently reoccurring code
patterns. App Dev 7, if we might call it that, has
pre-defined. It also allows for the creation of new
templates or edits of existing templates.

By typing some of the statement to be added, then
pressing Ctrl+Spacebar a list of matching templates
appears in a list.The list is filtered as you type. A
template is color coded yellow to distinguish it
from a Java statement.


Configuring Templates

Select Windows → Preferences → Java → Editor →
Templates

Click 'New' to add a new template. A text area is
provided in which the new template needs to be
coded. 

'Insert Variable' is used to select from a list of
predefined variables.

Template can be both imported and exported.


Compiler Options

Compilers generate warnings or errors. Warning do
not affect correct program execution.  Java Language
Specification, compiler errors are always reported as
errors by the Java compiler.

Other problems can be labeled as if they are warnings,
errors or something to be ignored.

Configuring Compiler Options

Select Window → Preferences → Java →Compiler


Four Compiler Option Sub-Divisions


Installed JREs

Application  Developer 7 allows you to specify which
Java Runtime Environment (JRE) should be used. By
default the standard Java VM that comes with the
product is used.

To ensure compatibility, the same JRE should be used
to compile code. For example, if an application is going
to be run on WebSphere Application Server V6.1, then
that JRE should be associated with this environment. 


Configuring the Installed JREs


Select Windows → Preferences → Java →Installed JREs


JRE Preferences


By default, the JRE running the Workbench will also be
used to build and run Java programs. This JRE appears
selected in the list of installed JREs.

If the target JRE required not on the list of JREs, then it
needs to be installed on the machine and added onto
the list. You can add, edit, or remove a JRE.

Steps to Adding a JRE
 // assuming target is JRE 1.6 @ C:\Program Files\Java\jre1.6

*Changing the JRE where code is executed  does not affect
the set up for Java source compilation. Compilation build path
is similarly adjustable.


That finishes a summary of the third chapter. We
should not get our 'hands on' a copy of the application
to see the features for ourselves.

Installing the Application

Three options should be available to us.

1) Use the Application at the school. This may not be
possible initially as we told the school of the application
change very late. It takes them time to procure the
application through their channels and then to install
it.

2) Use the 60 trial from the IBM site. The pdf draft
has installation information in the Appendix A. You
will need to join IBM's site and need a high speed
connection.

3) Once you have signed on with IBM you can use
their online trial version of the application. This gives
you 3 hours trial time at a sitting.


Trial and Online Versions


http://www.ibm.com/developerworks/downloads/r/rad/tryonline.html



Assignment


Access Application Developer and provide the
following screenshots. If you were not able to access
the application please submit a short explanation of
the obstacles you encountered.

1) Screenshot The logging preference window set to
7 days.

2) Screenshot 2
:
Show the team capability being
enabled via the human icon on the welcome page.

3) Screenshot 3: Screenshot the Content Assist Page.