TechWave2004 TechWave2004 TechWave2004 - SYS

Transcription

TechWave2004 TechWave2004 TechWave2004 - SYS
POCKETBUILDER DESIGN
pg. 28
U.S. $15.00 (CANADA $16.00)
SEPTEMBER 2004 - Volume: 11 Issue: 9
www.sys-con.com/pbdj.com
From the Co-Editors
PFC Reborn
Sybase releases
PowerBuilder Foundation Classes
as open source
by Bruce Armstrong pg. 3
Euphemisms
Decoding job description
euphemisms on
online job sites
Bob Hendry pg. 4
Industry Announcements
by Bruce Armstrong pg. 34
Sybase released PowerBuilder 10.0,
which introduces a number of new
features including Unicode support, the
XML DataWindow, and refactoring support
•••
DataWindow.NET 1.0 is an
implementation of the PowerBuilder
DataWindow, DataStore, and
Transaction classes as .NET components
pg.12
Technical Analysis: Bullish
or Bearish – Buy or Sell
How PowerBuilder can help you make money
Feature: TechWave 2004
Show Report A review of
Berndt Hamboeck
6
Bruce Armstrong
Web Services Edge
the keynotes, sessions, and more
February 15-17, 2005
Book Excerpt: PowerBuilder Millard F. Brown III
Foundation Classes Getting started
18
On Par: What Happened
Mike Deasy
to Tiger? Is it happening to you?
26
PocketBuilder: PocketBuilder
Ian Thain
Application and UI Design
2005 East
Hynes Convention Center
Boston, MA
See page 31 for details
RETAILERS PLEASE DISPLAY
UNTIL NOVEMBER 30, 2004
$15.00US $16.00CAN
09
03
0
09281 01314
3
Do’s and don’ts of mobile development
12
28
FROM THE CO-EDITOR
EDITORIAL ADVISORY BOARD
BRUCE ARMSTRONG, MICHAEL BARLOTTA, ANDY BLUM,
KOUROS GORGANI, BAHADIR KARUV, PhD,
BERNIE METZGER, JOHN OLSON, SEAN RHODY, IAN THAIN
COEDITOR-IN-CHIEF:
COEDITOR-IN-CHIEF:
EXECUTIVE EDITOR:
ASSOCIATE EDITOR:
ASSOCIATE EDITOR:
ASSISTANT EDITOR:
ONLINE EDITOR:
CONTRIBUTING EDITOR:
TECHNICAL EDITOR:
NEWS EDITOR:
DATAWINDOWS EDITOR:
RESEARCH EDITOR:
BRUCE ARMSTRONG
BOB HENDRY
NANCY VALENTINE
JAMIE MATUSOW
GAIL SCHULTZ
TORREY GAVER
MARTIN WEZDECKI
JOHN OLSON
BERNIE METZGER
BRUCE ARMSTRONG
RICHARD BROOKS
BAHADIR KARUV, PhD
WRITERS IN THIS ISSUE
BRUCE ARMSTRONG, MILLARD BROWN, MIKE DEASY,
BERNDT HAMBOECK, BOB HENDRY, IAN THAIN
SUBSCRIPTIONS
FOR SUBSCRIPTIONS AND REQUESTS FOR BULK ORDERS,
PLEASE SEND YOUR LETTERS TO SUBSCRIPTION DEPARTMENT
SUBSCRIPTION HOTLINE:888 303-5282
COVER PRICE: $15/ISSUE
DOMESTIC: $149/YR. (12 ISSUES) CANADA/MEXICO: $169/YR.
OVERSEAS: BASIC SUBSCRIPTION PRICE PLUS AIRMAIL POSTAGE
(U.S. BANKS OR MONEY ORDERS). BACK ISSUES: $12 U.S., $15 ALL OTHERS
PRESIDENT AND CEO: FUAT KIRCAALI
VICE PRESIDENT,BUSINESS DEVELOPMENT: GRISHA DAVIDA
SENIOR VP,SALES & MARKETING: CARMEN GONZALEZ
PRODUCTION CONSULTANT: JIM MORGAN
GROUP PUBLISHER: JEREMY GEELAN
VICE PRESIDENT,SALES & MARKETING: MILES SILVERMAN
ACCOUNTS RECEIVABLE SHANNON RYMSZA
FINANCIAL ANALYST: JOAN LAROSE
ACCOUNTS PAYABLE: BETTY WHITE
ADVERTISING DIRECTOR: ROBYN FORMA
DIRECTOR, SALES & MARKETING: MEGAN MUSSA
ASSOCIATE SALES MANAGER: KRISTIN KUHNLE
ASSOCIATE SALES MANAGER: BETH JONES
ASSOCIATE SALES MANAGER: DOROTHY GIL
PRESIDENT,EVENTS: GRISHA DAVIDA
EVENTS,NATIONAL.SALES MANAGER: JIM HANCHROW
ART DIRECTOR: ALEX BOTERO
ASSOCIATE ART DIRECTOR: LOUIS F. CUFFARI
ASSOCIATE ART DIRECTOR: RICHARD SILVERBERG
ASSOCIATE1 ART DIRECTOR: TAMI BEATTY
ASSISTANT ART DIRECTOR: ANDREA BODEN
VICE PRESIDENT,INFORMATION SYSTEMS: ROBERT DIAMOND
WEB DESIGNER: STEPHEN KILMURRAY
WEB DESIGNER: MATTHEW POLLOTTA
CIRCULATION SERVICE COORDINATOR: EDNA EARLE RUSSELL
CIRCULATION SERVICE COORDINATOR: LINDA LIPTON
EDITORIAL OFFICES
SYS-CON MEDIA
135 CHESTNUT RIDGE ROAD, MONTVALE, NJ 07645
TELEPHONE: 201 802-3000
FAX: 201 782-9600
[email protected]
POWERBUILDER DEVELOPER’S JOURNAL (ISSN#1078-1889)
is published monthly (12 times a year) for $149 by
SYS-CON Publications, Inc.,135 Chestnut Ridge Rd., Montvale, NJ 07645
Periodicals Postage rates are paid at
Montvale, NJ 07645 and additional mailing offices.
POSTMASTER: Send address changes to:
POWERBUILDER DEVELOPER’S JOURNAL, SYS-CON Publications, Inc.,
135 Chestnut Ridge Rd., Montvale, NJ 07645
©COPYRIGHT
Copyright © 2004 by SYS-CON Publications, Inc. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or by any
means, electronic or mechanical, including photocopy or any information storage and
retrieval system, without written permission. For promotional reprints, contact reprint
coordinator Kristin Kuhnle. SYS-CON Publications, Inc., reserves the right to revise,
republish and authorize its readers to use the articles submitted for publication.
WORLDWIDE NEWSSTAND DISTRIBUTION
Curtis Circulation Company. New Milford, NJ
NEWSSTAND DISTRIBUTION CONSULTANT
Gregory Associates/W.R.D.S. 732-607-9941 [email protected]
FOR LIST RENTAL INFORMATION:
Kevin Collopy: 845 731-2684, [email protected]
Frank Cipolla: 845 731-3832, [email protected]
All brand and product names used on these pages are trade names,
service marks or trademarks of their respective companies.
SYS-CON Publications, Inc., is not affiliated with the companies
or products covered in PowerBuilder Developer’s Journal.
PFC Reborn
BRUCE ARMSTRONG
I
f you’re a big fan of the PowerBuilder Foundation Classes (PFC), I’ve got some good news
for you, or perhaps you’ve already heard. With the release of PowerBuilder 10.0, Sybase
concurrently released the PFC as open source. The project is being hosted on Sybase’s
CodeXchange site at http://pfc.sourcexchange.sybase.com.
What does this mean for you? Well, it means a few things:
1. You no longer need the Enterprise or Professional versions of PowerBuilder to use the
libraries. Anybody can now freely download the files and use them in their projects.
2. The number of people who are working on the base PFC code has expanded considerably.
Even in the best PowerSoft/Sybase days, the number of developers working on PFC was
probably never more than a dozen. With the code available as open source, the number of
developers working on the product can expand to considerably more than that.
3. You no longer have a long wait between the time you report a bug and the time it’s fixed.
The bug also doesn’t drop off into a black hole either; you can follow its progress as it’s
being worked on and see the fix incorporated into the code base.
LGPL Licensing
The open source PFC source code is being licensed under the GNU Library General
Public License (LGPL). It’s important to distinguish that license from a couple of other
licensing types: the GPL license and a release to the public domain.
The GNU General Public License (GPL) license – such as the one that the GhostScript
utility that the PowerBuilder Distiller method relies upon to create PDF files – is a “viral”
license. It’s considered viral because any program that makes use of such code becomes GPL
software when it’s distributed, requiring you to allow all of your end users to have access to
your source code on demand. That might not be a significant issue for software done inhouse, but it becomes a significant issue for companies attempting to produce commercial
software. That’s why Sybase doesn’t distribute GhostScript with PowerBuilder.
Source code that’s released to the public domain can be used for just about any purpose
with little or no restrictions. You could take such code and redistribute a compiled version as
your own product with few or no changes and without giving credit to the original author.
Open source licensed under the LGPL differs from public domain in that:
• When you distribute your application that uses an LGPL library, you must make the
source code for the LGPL library available to your end users.
• If a copyright is displayed in your application, the copyright of the LPGL library must be
displayed as well.
The bottom line is that you are free to use the open source PFC libraries within your
applications, whether they are in-house or commercial applications. When you use the open
source PFC libraries within your applications, you must acknowledge that the open source
PFC source code is not your own creation. You could even modify the open source PFC
library source code and redistribute it as your own framework, but you would still need to
acknowledge that the original source code came from the open source PFC project.
The other good news is that the project is being headed up by some of the best
PFC/PowerBuilder minds in the business:
• Alex Whitney: The originator and manager of the PFC development team at Sybase
• Boris Gasin: One of the authors of the McGraw-Hill book PowerBuilder Foundation Class
Professional Reference and maintainer of the PFCGuide.com Web site
• Terry Voth: Author of PBL Peeper and maintainer of the Techo-Kitten.com Web site
• Myself: Jack-of-all-trades – master of none…
We will be using the sybase.public.powerbuilder.pfc newsgroup as the discussion ground
to talk about the future of the product. I look forward to conversing with you there. ▼
[email protected]
AUTHOR BIO
Bruce Armstrong is a senior programmer with Integrated Data Services (www.get-integrated.com). A member of TeamSybase,
he has been using PowerBuilder since version 1.0.B. He was a contributing author to SYS-CON’s PowerBuilder 4.0
Secrets of the Masters and the editor of SAMs’ PowerBuilder 9: Advanced Client/Server Development.
www.SYS-CON.COM/pbdj/
PBDJ volume11 issue 9
3
FROM THE CO-EDITOR
Euphemisms
Understanding online job sites
WRITTEN BY
BOB HENDRY
live in the midwest where we have a
seasonal insect known locally as a
“June Bug.” These flying bugs are
the size of small Buicks and have
absolutely no aerial navigation skills. On
warm summer evenings, these bugs can
be observed in choreographed crazy
straw flight patterns that usually end in
spectacular crashes into windshields,
window screens, or the drink on your
lap. June Bugs are not pleasant visitors.
Truth be known, June Bug is not their
official name. The scientific
name is something like
“Giaganyous Wingous
Cockroceous,” which in English
translates to “Giant Flying
Cockroaches.” The trouble is, many
people have a hard time saying Giant
Flying Cockroaches and would rather
stick with the cuddly term June Bug – a
necessary euphemism to say the least.
I
Now that the IT world is picking up, I
have combed various online job sites and
spent hours looking through the job
description euphemisms. Here I’ll translate some of them into their true meaning. Hope this helps.
AUTHOR BIO
Bob Hendry is a
PowerBuilder instructor
for Envision Software
Systems and a frequent
speaker at national
and international
PowerBuilder conferences.
He specializes in
PFC development
and has written two
books on the subject,
including Programming
with the PFC 6.0.
4
CREATIVE BENEFIT PACKAGE
The employee will be responsible for
a greater share of medical insurance
and all of dental. The corporation has
eliminated sick, personal, and vacation
days and created a “space bank” of days
you are allowed to take off. In lieu of
salary, you’ll be offered company stock
that currently is not worth much, and
probably will not be worth much in the
future.
ETHNICALLY DIVERSE ENVIRONMENT
Most of your co-workers are foreign
born and some don’t speak English. As a
matter of fact, most of your co-workers
are in developing countries. You are
PBDJ volume11 issue 9
expected to work around the clock and
coordinate code reviews from Belfast to
Bangalore.
FAST-PACED ENVIRONMENT
The company does not have nearly
as much staff as it needs. Because of
this, you will be expected to work
around the clock (see Ethnically Diverse
Environment). Forget about dinner with
the family and weekends on the lake.
Also, there is little time spent on project
planning. You are expected to make
hopeless decisions on the fly, that
way when they don’t work, the
company can blame
you. Remember anything is possible with an
unlimited supply of expendable labor; just ask the Egyptians
– they built the pyramids.
EQUAL OPPORTUNITY EMPLOYER
Mid-career males need not apply.
OFFER VALUABLE EXPERIENCE
This is a tough one. Organizations
know that IT professionals like to stay
current with new technologies, and
some of us will do about anything
to get a job that will give this to
us. The trouble is that since
companies know this, they can
save a bit on salaries. After
all, if asked which is more
important, working with
new technologies or
money, what would you
choose? You ungrateful
money-grubber you.
CELEBRATE DIVERSITY
Eventually you’ll be expected to train a
foreign-born replacement to do your job.
The company is currently enjoying the
“celebration” by replacing senior highpaid staff with cheaper workers.
CUSTOMER FOCUSED
You’ll work on the software support
line. No matter what else is in the job
description, expect to spend a majority of
your time fixing the problems of others
(see Fast-Paced Environment). There is no
new development at this company. Expect
to spend most of your time listening to
crabby people telling you their problems.
STRONG COMMUNICATION SKILLS
Management is young and inexperienced and needs everything explained to
them by a third-grade teacher. Forget
high-level PowerPoint presentations.
Instead of using charts, use prompts
such as Barney puppets and Play-Doh. To
keep everyone motivated, pump up the
room with MTV on the overhead projector. Avoid Brittany though, she’s so yesterday. In addition, you’ll spend time on
the phone with your offshore co-workers
(see Ethnically Diverse Environment).
CUTTING EDGE
Rather than buying industry-standard
tools and having to pay for those pesky
vendor-support agreements, they have
created their own – and nobody
really understands how they
work. The software may be so
cutting edge that any experience using them will be worthless outside of the organization.
STRONG TROUBLESHOOTING SKILLS
The conversion to Java did not
work as planned and now nothing
works. You will be expected to debug
impossibly complex and half-converted
systems.
SELF-STARTER
You are so sick of your current gig of
(pick one):
~continued on page 32~
www.SYS-CON.COM/pbdj/
TECHNICAL ANALYSIS
Bullish or Bearish –
Buy or Sell
WRITTEN BY
BERNDT
HAMBOECK
How PowerBuilder can help you make money
ou may already have invested
some of your money in stocks
or individual securities. You
may have earned some money,
or, as 90% of investors do, you may
have lost some of your money.
Y
That’s how it works in stock markets:
some buy stocks and some sell stocks,
some make money and some lose
money. Although this may sound like
gambling or a risky game of roulette,
there are steps we can take to enhance
our chances. It is the practice of technical analysis that might give us the
needed advantage to be on the winners’ side, to be among the few who
make money instead of losing it. The
term “technical analysis” is a complexsounding name for a basic approach
to investment. Simply put, technical
analysis is the study of prices using
charts of one or more stocks as the
primary tools. But be careful, investing
would be too easy if we knew what the
stock market would do tomorrow.
However, if you continue reading this
article with the hope that technical
analysis using PowerBuilder will
improve your investing, I am quite
sure that you will be satisfied.
Quotes - What We Need
AUTHOR BIO
Berndt Hamboeck is a
senior consultant for
BHITCON (www.bhit
con.net). He’s a CSI,
SCAPC8, EASAC, and
SCJP2 and started his
Sybase development
using PB5.
6
Technical analysis is almost entirely
based on volumes and prices from the
past. The different quotes that define a
security’s price and volume are
explained below.
• Open price: This is the price of the
first trade for the period (usually the
first trade of a given day). This value
is important, as it shows the consensus reached overnight by all parties
trading the security.
• High price: This is the highest price
of trading for the security during a
day or period. The high price is
reached when there are more sellers
than buyers because, without addi-
PBDJ volume11 issue 9
tional buyers, the security cannot
climb higher. (There are always sellers willing to sell at higher prices, but
the High represents the highest price
buyers were willing to pay.)
• Low price: This is the lowest price
that the security traded at during a
day or period. The low is reached
when there are more buyers than
sellers; it is the lowest price that the
sellers were willing to accept, so the
security will not fall any farther.
• Close price: This is the last price that
the security traded at during a day or
period. This is the price most frequently used for technical analysis.
The relationship between the Open
(the first price) and the Close (the last
price) is considered significant by
most technical investors.
• Volume: This is the number of shares
or contracts that were traded during
a day or period. The relationship
between price and volume (increasing prices often accompany increasing volume) is important and should
not be disregarded when it comes to
technical analyses. The analysis of
the relationship often provides a pattern or indicator on which to draw
conclusions.
If you have access to real-time
quotes, you will also be able to get your
hands on two additional values of interest:
• Bid: This is the price that a market
maker is willing to pay for a security
(the price you will receive if you sell).
• 1Ask: This is the price that a market
maker is willing to accept (the price
you will pay to buy the security).
These simple fields are used to create hundreds of different technical indicators used to study price relationships,
trends, patterns, and so on. But where
will we get this data from, so that we get
the needed advantage over the other
players out there?
GETTING THE DATA
This is quite simple, since Yahoo
offers the service. Visit http://finance.
yahoo.com/l, enter the ticker symbol of
the security, and select the dates of the
period in which you are interested. In
my case, the security is Adidas (ticker
symbol ADSG.DE). If you don’t have the
ticker symbol of the security you are
looking into, you can search for it on the
site.
As you can see in the following
script, we use the inet object to get the
data as a CSV file, which can easily be
imported into a DW (see Figure 1). Just
take care that in Europe you use commas as the decimal separators so that
your data is not imported incorrectly
into the external DataWindow (for
example, the value 9301,00 should be
93,01).
To get the security values, enter the
following:
Date ldt_today
Integer li_day, li_month, li_year
inet linet
n_result ln_result
linet = CREATE inet
ln_result = CREATE n_result
li_day = Day(today())
li_month = Month(today())
li_year = Year(today()) - 2000
FIGURE 1 | Stock data from Yahoo
linet.GetURL("http://216.109.124.111/t
able.csv?s=" + as_ticker + &
"&d="+ String(li_month)+"&e="+
www.SYS-CON.COM/pbdj/
©2003 Sybase, Inc. All rights reserved. All trademarks are the property of their respective owners.
4GL RAD Tools
HE SAYS J2EE.
SHE SAYS .NET.
YOU SAY POWERBUILDER
PowerBuilder® 9.0 gives you the power
and flexibility to create applications for
the platform of your choice in today’s
heterogeneous environments. You’ll find
new RAD JavaServer TM Pages, tools for
Web Services, third-party application
server support and more. Get the power
you need to develop and integrate
new Web, n-tier and rich-client apps.
Technical details are waiting for you
now at sybase.com/powerbuilder.
INFORMATION LIQUIDITY.
SYBASE INTEGRATION TECHNOLOGIES.
E V E R Y T H I N G W O R K S B E T T E R W H E N E V E R Y T H I N G W O R K S T O G E T H E R .TM
FIGURE 2 | Line chart including Bollinger Bands and RSI
FIGURE 3 | Bar chart
FIGURE 5 | Candlestick chart
String(li_day)+"&f=" +
String(li_year)+ &
"&g=d&a=01&b=01&c=03&ignore=.csv",
ln_result)
ln_result.is_data =
Right(ln_result.is_data,
Len(ln_result.is_data) Pos(ln_result.is_data, "~n"))
ln_result.is_data =
Left(ln_result.is_data,
Pos(ln_result.is_data, "<!")-1)
adw_data.Reset()
adw_data.ImportString(CSV!,
ln_result.is_data)
return 1
Charts - Drawing the Quotes
Now we have the quotes, but what
should we do with them? Well, the chart
is the foundation of technical analysis.
But which type? There are several possible ways to chart the data.
LINE CHARTS WITH VOLUME
A line chart is the simplest type of
chart. As shown in the chart of Adidas
data in Figure 2, the single black line
represents the security’s closing price
8
PBDJ volume11 issue 9
FIGURE 4 | Candlesticks explained
on each day. Prices are usually displayed on the side(s) and the volume is
usually displayed as a bar graph at the
bottom.
A line chart’s strength comes from
its simplicity. It provides an uncluttered, easy-to-understand view of a
security’s price. Line charts are typically
produced using a security’s closing
prices.
price is the bottom of the candle body
and again, if there are lines, they represent highs and lows during the day or
period (see Figure 4).
The interpretation of candlestick
charts is based primarily on patterns
where, for example, one or more of a
special type of candle is followed by
another. See Figure 5 for a complete
example of a candlestick chart.
BAR CHARTS
A bar chart displays a security’s
open (if available), high, low, and closing prices. Bar charts are the most popular type of charts. As illustrated in the
bar chart in Figure 3, the top of each
vertical bar represents the highest price
that the security traded during the period, and the bottom of the bar represents the lowest price that it traded. A
closing “tick” is displayed on the right
side of the bar to designate the last
price that the security traded. Opening
prices are signified by a tick on the left
side of the bar.
Indicators
CANDLESTICKS
Candlestick charting is a method
developed by the Japanese in the 1600s
to help analyze the price of rice contracts. The graph is made up of either
black or white candle bodies, often
with lines on both ends. A single white
candlestick body indicates that the
opening price was at the bottom of the
body of the candlestick. The closing
price for the period displayed is the
top of the candlestick body. If the candle has lines on either end, the line on
the bottom of the body represents the
low prices traded during that day or
period and the line on top indicates
the high of the period. When a candle’s
body is black, the opening price is the
top of the candle body and the closing
An indicator is a mathematical calculation that can be applied to a security’s price and/or volume fields. The
result is a value that is used to anticipate future changes in prices. A moving average fits this definition of an
indicator: it is a calculation that can be
performed on a security’s price over
time to yield a value that can be used
to anticipate future changes in prices.
There are many different indicators
out there; we are briefly going to
review two indicators here, the Relative
Strength Index (RSI) and Bollinger
Bands.
THE RELATIVE STRENGTH INDEX (RSI)
Two of the most overused terms in
technical analysis are “overbought”
and “oversold.” RSI is often used as a
way of determining when something is
overbought or oversold. The term overbought is intended to mean that the
product in question is at risk of reversing lower, because its price has risen
too far and too fast. Inversely, oversold
refers to stock that might be in a position to reverse higher, because its price
has fallen too far, too fast. RSI offers
you one way of quantifying overbought
and oversold. The 70 level is generally
considered to be overbought and the
30 level to be oversold.
The formula used to calculate RSI is
www.SYS-CON.COM/pbdj/
Source: 08830081A
GET MORE
OUT OF
®
POWERBUILDER
WITH
POWERDESIGNER 9.5.2!
®
• Integrate PowerBuilder logic in a heterogeneous
environment that includes Java,™ J2EE™ and
.NET™ to ensure PowerBuilder skills stay
relevant in the modern IT infrastructure.
• Manage simple and complex designs easily
using unique features like Object/Relational
mapping, customizable pattern based code
generation, VBScript customization, and more…
• Easily re-factor code from ANY PowerBuilder
object into an n-tier architecture with complete
reverse engineering capabilities.
• Apply the advantages of UML to PowerBuilder
development with comprehensive code generation
and round-trip engineering.
Download a FREE evaluation copy
of PowerDesigner 9.5.2 Today!
www.sybase-iad-services.com/30081a
1-877-230-6771 | www.sybase-iad-services.com/30081a
ldec_sumUp / li_up
IF li_down > 0 THEN
ldecSumDown = ldecSumDown / li_down
ldec_rs = ldec_sumUp / ldecSumDown
ELSE
ldec_rs = 0
END IF
ldec_rsi = 100 - (100 / (1 +
ldec_rs))
next
FIGURE 6 | Choose a
security
FIGURE 7 | Display the
chart on your PocketPC
as follows:
RSI = 100 – [100/(1+RS)]
*RS = Average of up day's closes /
Average of down day's closes
This average is determined by summing up the total price gains on up
days and dividing by the total number
of price changes you are examining for
the up average. For the down average,
add up the absolute value of the
changes on the days that prices fell,
then divide that figure by the number
of price changes. The classic number
used in the calculation for RSI is nine
days or periods.
Therefore, we need at least 10 days
of prices to compute a nine-day RSI.
For an example, see Figure 2. In
PowerBuilder, we would use the following script to compute the RSI.
for ll_from = 10 to ll_to
ldec_Ptoday =
idw_data.getItemDecimal
(ll_from, "closed")
li_up = 0
li_down = 0
for ll_from2 = ll_from -8 to
ll_from
ldec_Ptold = idw_data.getItem
Decimal(ll_from2 -1, "closed")
ldec_Ptoday =
idw_data.getItemDecimal(ll_from2,
"closed")
IF ldec_Ptoday > ldec_Ptold THEN
li_up++
ldec_sumUp+= (ldec_Ptoday ldec_Ptold)
ELSEIF ldec_Ptoday < ldec_Ptold
THEN
li_down++
ldecSumDown+= (ldec_Ptold ldec_Ptoday)
END IF
next
IF li_up > 0 THEN ldec_sumUp =
10
PBDJ volume11 issue9
BOLLINGER BANDS
Bollinger Bands consist of a moving average and two standard deviations. The standard deviations are
charted as one line above and one
line below the moving average. The
line above represents the values two
standard deviations above the moving average. The line below represents values two standard deviations
below the moving average. Traders
generally use the lines to determine
overbought and oversold zones, to
confirm divergences between prices
and indicators, and to project price
targets. The wider the bands are, the
greater the volatility. The narrower
the bands are, the lesser the volatility. The moving average is calculated
on the close.
Volatility in this case is measured as
the statistical standard deviation computed on the same set of data as the
moving average. To compute the
bands, it is recommended that you use
a 26-Day Moving Average (which is the
arithmetic average of the previous 26
days or periods).
Although there are many ways to
use Bollinger Bands, the following are
a few rules that serve as good beginning points:
• Contracting bands warn that the
market is about to trend: the bands
first converge into a narrow neck,
followed by a sharp price movement.
The first breakout is often a false
move, preceding a strong trend in
the opposite direction.
• In a ranging market, a move that
starts at one band normally carries
through to the other.
• A move outside the band indicates
that the trend is strong and likely to
continue – unless price quickly
reverses.
• A trend that hugs one band signals
that the trend is strong and likely to
continue.
To compute the bands, we have to
calculate the moving average. The for-
mula is:
where Pn is the price you pay for the
nth interval and n is the number of periods you select.
The next step is to subtract the moving average from each of the individual
data points used in the moving average
calculation. This gives us a list of deviations from the average. Square each
deviation and add the squares together.
Divide this sum by the number of periods you selected.
Now, take the square root of d. This
gives us the standard deviation.
The last step is to compute the values for the three bands:
Upper Band = MA+28
Middle Band = MA
Lower Band = MA 28
Refer back to Figure 2 for an example of Bollinger Bands. The Upper
Band is drawn in green, the Average
Band in gray, and the Lower Band in
blue.
The Pocket Builder
Implementation
Note that the Pocket Builder implementation does not support the inet
object at this time. To avoid the problem, you may want to use PocketSOAP
to get the quote for your security
instead (see Figure 6). Also, although the
display is not as big as it would be on a
desktop, it is still possible to draw the
charts, as you can see in Figure 7.
Conclusion
Trading securities can be a lot of fun,
as long you get money out of it. To
increase your chances of being one of
the winners, you should definitely have
a look at technical analysis. But remember, past results are not necessarily
indicative of future results, so take care
of your money! I wish you a lot of fun
with technical analyses and
PowerBuilder. If you want to have a look
at the full stock application, feel free to
download a free version, written in
PowerBuilder and Pocket Builder from
http://www.pocketpb.com. ▼
[email protected]
www.SYS-CON.COM/pbdj/
T H E S T R A I G H T G O O D S O N E A S e r v e r.
BRING APPS TO THE WEB
WITHOUT LEAVING
YOUR POWERBUILDER
INVESTMENT
BEHIND.
It’s easy. It’s proven. Sybase EAServer is the
have all rapidly web-enabled their PowerBuilder apps
complete solution with the highest ROI
with a faster and easier time to market. To discover how
for moving PowerBuilder applications to the
you can leverage your existing investments, check out
Web. But don’t just take our word for it. Sierra
our ROI Case Study Guide at
Club, The Greenbrier Companies and Hennepin County, MN,
www.sybase.com/pbextension. I n f o r m a t i o n A n y w h e r e™
S Y B A S E e - B U S I N E S S S O F T W A R E.
TM
E V E R Y T H I N G W O R K S B E T T E R W H E N E V E R Y T H I N G W O R K S T O G E T H E R.
©2002 Sybase, Inc. All rights reserved. All trademarks are the property of their respective owners.
TechWave2004 TechWave2004 TechWave2004 TechWave2004
SHOW REPORT
TechWave
2004
August 15–19 Orlando, FL
WRITTEN BY
BRUCE ARMSTRONG
A review of the keynotes,
sessions, and more
The question that the folks who didn’t attend generally ask is:
“How was it?” Unfortunately, I was a bit too close to the action
this year to give an adequate answer, but I did keep a daily blog,
which is presented to you here.
conference prior to ours that was just ending.
The additional good news is that the hotel Internet connections
were working well this year.
Registration
Getting to TechWave
Registration was a piece of cake like last year. The e-mail kiosks
are back, as well as the Internet hot spots throughout the conference
area.
Compared to a lot of other folks, I got to the conference pretty
easily despite Hurricane Charley. My flight wasn’t delayed and the
shuttle from the airport to the convention center arrived within minutes of my obtaining the ticket. A number of other people had to
take alternate flights into Tampa Bay or even Atlanta and then drive
in. I also heard of people having to wait an hour or more for a shuttle
from the airport.
There was some hurricane damage at the Orlando airport. I saw a
broken window around the tram that takes you from the terminal to
baggage claim. The convention center was unharmed, but there was
damage in the neighboring areas, such as a downed tree in the parking lot and damaged signage at the local businesses.
The folks from the power company who were doing emergency
repairs were also staying at the conference center hotel, so one of the
sights we were treated to was a huge line of work crews heading out
to do repairs.
They’ve added a lot more entertainment at the hotel this year.
There was a laser light show in the atrium every night at 9:30 p.m.,
and when I arrived, there were also a number of entertainers performing throughout the hotel, although it may have been for the
Opening Session
Sybase hasn’t announced where TechWave 2005 will be, but John
Chen, CEO of Sybase, did indicate during the opening session that
it’s returning to the West Coast. He also presented some arguments
that this is finally the year when wireless (unwired) technologies will
take off.
John Davies, vice president for solutions at Intel, talked about
some of the initiatives that involve both Intel and Sybase technologies; he then brought out Juan Jose Ferreris, a physician, who discussed how he uses a Sybase-based technology to implement an
electronic medical records system (MediNotes). Ferreris was followed by Brian Vink, vice president of marketing for iAnyWhere, who
presented the 2004 Innovator Award to Gavril Nanaziashvili of
MediNotes and John Greisz of DB Microware.
Cindy Bean, ISUG President, made the 2004 ISUG Achievement
Award to Sethu Meenakshisunderam (Sybase director of engineering
for the Data Management Group), Luc Van der Veurt (former ISUG
11
12A
12
13A
13
14A
14
15A
15
11
12A
12
13A
13
14A
14
15A
15
12
PBDJ volume11 issue9
www.SYS-CON.COM/pbdj/
TechWave2004 TechWave2004 TechWave2004 TechWave2004 TechWave2004
president and current member at large), and myself.
Database Keynote
One big improvement this year: instead of trying to have the database and tools keynotes in a single session, they were split up. The
database keynote was on Tuesday morning and the tools keynote on
Wednesday.
The database keynote was introduced by Raj Nathan, Sybase vice
president. He was followed by Tom Rabon, executive VP of corporate
affairs for Red Hat, who talked about Red Hat’s relationship with
Sybase.
Irfan Khan, director of evangelism for Sybase, then discussed new
features and options in upcoming ASE versions such as dynamic
archiving and dynamic auditing. Javier Cuerva, a Sybase evangelist,
then demonstrated some of these new features.
On the iAnywhere side, Dave Neudoerffer discussed new features
in a number of the iAnywhere products such as server-initiated synchronization, then Alex Reif gave a demo of some of those new features.
evangelist, demonstrated PowerDesigner 10 followed by a video of
Raj talking about PowerBuilder and PowerDesigner, and Jim Sheehan
of PowerObjects, a Sybase VAR.
Dave Fish, PowerBuilder specialist, spoke about “DataWindows
Everywhere” followed by a demo of DataWindow.NET. Version 1.5 of
DataWindow.NET will add support for Web forms and dot notation –
the beta of which will start by the end of this year. DataWindow.NET
2.0 will add support for DataSets, the incorporation of the
DataWindow Designer into the IDE, and support for .NET 2.0 when it
becomes available. The release of DataWindow.NET 2.0 is planned
for the end of 2005.
Dave also indicated that PowerBuilder 11+ (also by the end of
2005) will also provide support for a generation of WebForms and
WindowForms in .NET.
The next video was of Irfan talking about Appeon and Web
DataWindows and Dean Jones of PowerObjects talking about their
success with Sybase products, including Appeon. Rex Geissler then
did a demo of the Web DataWindow and Appeon.
Jonathan Baker talked about “Street Team,” a program designed to
reward people for contributing to SDN.
Tools Keynote
The tools technote opened with a “birthday cake” for Sybase, celebrating 20 years of business.
Jonathan Baker, PowerBuilder evangelist, talked about the history
of PowerBuilder; then a video was shown that included Raj Nathan
and Alex Whitney, a former Sybase employee and current Sybase customer. John Strano, PowerBuilder evangelist, talked about features of
the just-released PowerBuilder 10 as well as some of the upcoming
features of PowerBuilder 11:
• .NET transformer
• Rich Internet architecture
• PowerScript enhancements
• DataWindow enhancements (UI and functionality)
• UI enhancements
• SOA support via enhanced Web services
He then demonstrated the XML DataWindow in PB10, and
TablePC support coming in PB 10.1 (such as the new ink picture control and the new signature control). That was followed by another
video of Kathleen Schaub, VP of marketing, and then Alex again.
Ian Thain then talked about Pocket PowerBuilder 1.5.2 and the
upcoming features in PocketBuilder 2.0, including phone enabling,
SmartPhone support, ADO.NET support, remote debugging, native
controls for new hardware, and WM2003-SE support. Ian finished
with a demo of PocketBuilder.
A video of Niel McGovern, director of strategy for XcelleNet, was
then shown, after which Shari Freeman, manager of Afaria, talked
about their product (Afaria is an XcelleNet product, and XcelleNet is
a recent Sybase acquisition).
Dimitri Volkman, worldwide product line director, Sybase enterprise products and technologies, tools, appeared in a video and
talked about PowerDesigner features with Mike Nicewarner, a
PowerDesigner customer.
Dave Dichman, product manager, and Matt Creason, product
“John Chen presented some
arguments that this is finally the
year when wireless (unwired)
technologies will take off”
Raj Nathan brought out Sue Dunnell and talked about the future of
PowerBuilder, PowerDesigner, and other tools. Unlike the slides shown
by the other presenters, his slides included a PBVM for Linux: 9 Q4
2005, 10 Q1 2005.
There should be a beta at end of this year or 1Q 2005 for a Java-centric (Eclipse-based) development center (Sybase Workspace).
At the end of the session, Raj and a number of Sybase staffers threw
“Street Team” T-shirts into the audience.
Enhancement Sessions
Oops! Somebody slipped up here. Major confusion. The schedule didn’t indicate where the enhancement sessions were being
held other than “conference center ballroom level.” Lots of people
were wandering around trying to figure out where they were supposed to be.
The tools enhancement session featured Brian Ennis of ISUG and
Dave Fish, Dave Dichman, Ian Thain, John Strano, and Jonathan
Baker. Brian talked about the purpose of ISUG and then demonstrated the enhancement request page on the ISUG Web site. John Strano
indicated the release schedule for the PBVM on Linux and the .NET
generators (which were noted in the tools keynote as well).
There were questions about improving graphing capabilities in
PowerBuilder. John indicated that improving the user interface was a
priority, but it was a question of prioritizing those enhancements.
5
16A
16
17A
17
18A
18
19A
19
5
16A
16
17A
17
18A
18
19A
19
www.SYS-CON.COM/pbdj/
PBDJ volume11 issue 9
13
TechWave2004 TechWave2004 TechWave2004 TechWave2004 TechWave2004
The community needs to let Sybase know which enhancements are
more important.
Someone suggested that PowerBuilder be modified to implement
features to duplicate Crystal Reports (in particular the ability to create drill-down reports with little or no coding).
One question was raised about PDF generation. John indicated
that such functionality was introduced in PowerBuilder 9. That was
followed by some discussion of GNU versus LGPL licensing (since
the GhostScript library used for PDF generation uses the GNU
license). This was followed by a discussion of the open source release
of PFC, which uses the LGPL license instead.
There was a complaint that the migration process was becoming
more difficult and there was a lack of documentation concerning it.
There was a question concerning Longhorn as well as XP SP2 support. Sybase indicated that they would be supported.
Somebody suggested supporting stored procedure editing within
the PB database painter, which Dave Fish indicated might make a
good official enhancement request. This person then indicated that a
number of the dialogs within the PB IDE were too small, and Dave
Fish explained that they were working on addressing that, including
making many of the dialogs resizeable.
There was mention of a thread in the newsgroups future_directions forum. Apparently there was some concern that enhancement
requests were being discussed in too many places and whether the
list for PB11 had already been settled. Dave indicated that the official
method of submitting requests is through the ISUG Web site. He also
reminded the attendees that everyone who attended the conference
automatically received an ISUG membership, so they would have the
right to enter the enhancement section.
PocketBuilder support for the Palm was brought up, but Ian stated that there were no plans for that. Since Palm recently lost the top
spot for the PDA OS market to Microsoft, they expected the downward trend in the Palm market share to continue.
“The community needs
to let Sybase know which
enhancements are more
important”
The same person had questions about support for XP SP2, and
John indicated again that it would be supported. His concern was
whether Sybase would indicate publicly if they discovered problems
with XP2 so that users would know whether to hold off on it.
It was noted that Visual Expert does a lot of very detailed analysis
and would PowerDesigner be improved to provide such a capability?
Dave Dichman and Dave Fish both indicated that they would leave
that kind of low-level analysis to the third-party market.
The question arose regarding integrating the DataWindow Painter
into the developers’ applications. Dave Fish thought that was a good
idea and said he would follow up with his management.
There was some discussion that the enhancement session should
Bruce Armstrong receiving ISUG Award from Cindy Bean.
be earlier in the week, especially not early in the morning the day
after the special event.
There was the obvious question about marketing. The audience
applauded…
Dave Fish said he would no longer promise that more marketing
was coming, since he was losing credibility by doing so. Karen
Frederiksen (director of marketing for tools) explained that there is a
corporate directive to focus marketing on the corporation and on
selling solutions, not tools. She indicated that there were some
efforts involved in getting Sybase tools considered for awards and
other “grass-roots” efforts.
Various audience members indicated that they were in the business of providing solutions to their customers (the companies they
work for), but their customers were unfamiliar with the products and
were concerned about using them. Dave Fish asked how Sybase
could improve this process. Audience members indicated that books
in the large stores (Borders, etc.) as well as products on the shelves of
local vendors (CompUSA) would help considerably.
Audience members indicated that the capabilities of the products
needed to be shown off. The advertising they have seen has too
much flash and not enough substance. The ads need to show customers how the product will apply to their business. The audience
wanted more tool-specific advertising, and Karen indicated that it
simply wasn’t the way Sybase corporate does marketing.
Karen indicated that it’s more helpful if people write articles for
magazines, as it’s more effective than plain ads.
Several requests were made, such as allowing composite reports
to incorporate DataWindows that have different layout orientations,
and allowing PowerBuilder to deploy components to application
servers other than EAServer. That was followed by a discussion of
which application servers should be supported and whether such
20A
20
21A
21
22A
22
23A
23
24A
20A
20
21A
21
22A
22
23A
23
24A
14
PBDJ volume11 issue 9
www.SYS-CON.COM/pbdj/
A
A
TechWave2004 TechWave2004 TechWave2004 TechWave2004 TechWave2004
support should be done before or after J2EE 1.4 certification.
There was some discussion of how PowerDesigner was able to
regain the top spot without marketing. Dave Dichman indicated that
marketing was actually being done, but it was precisely targeted.
One person asked about improving PowerDesigner so that it handled database modification scripts better, like some third-party tools.
Dave Dichman indicated that they were looking at that. Another person indicated that they loved the install process.
A consultant from Utah indicated that the local universities had
stopped teaching PowerBuilder and were pushing .NET and Java
instead. Karen said that the education program has been restarted
overseas and they were hoping to bring it back to the U.S. soon. Dave
Fish pointed out that there were now academic versions of the products as well.
you try to present it in a short, flashy demo. Millard Brown and I
spoke with John Strano (who participated in the PowerBuilder
keynote) about some ideas to get more audience involvement in the
keynotes. On the other hand, I liked the customer interview videos,
particular the one in which Michael Nicewarner described
PowerDesigner as the “least frustrating” design tool he’s worked
with…
BREAKFAST/BREAKS
I’ve got my standard complaint here. This year they seemed to
have fruit in addition to the high carb stuff for breakfast, but I’d still
like to see some other options. And I’d still like to see something
offered during the break. I talked with Richard Rogers of Sybase (the
guy who sets up all these TechWaves) afterwards about the costs
involved with refreshments during the breaks and I now understand
the issues, but I’d be willing to pay for them (and I did anyway,
because I ended up walking over to PlanetJava during the breaks).
AM SESSIONS
Millard Brown and I presented one of the four-day AM classes
(AM40 – Fast Track to PowerBuilder 10), so I never got a chance to
see how any of the other AM classes were doing.
WELCOME RECEPTION
Because of some of the travel issues this year, SyberJam (a band
involving several Sybase employees and a TeamSybase member)
weren’t able to perform this year. They did have a DJ playing ’80s
tunes and ’80s video shots on the big screen and pinball machines
from the ’80s available (a flashback to 20 years ago when Sybase was
first founded).
PM SESSIONS
Alex Whitney, Terry Voth, and I also did a Wednesday PM session
on PFC – Open Source. Since we asked to have it added at the last
minute we ended up spending a lot of the PM session time working
on that presentation. I did manage to make it to a couple of sessions:
one by Anthony Hill on PowerDesigner tips and tricks, which was
good (main issue was that I was already familiar with the material)
and one by Reed Shilts on advanced PocketBuilder topics (which was
very good).
“The education program has
been restarted overseas and
they were hoping to bring it
back to the U.S. soon”
EXHIBIT HALL
The only point at which I spent any considerable time in the
exhibit hall was during the ISUG book signing Monday evening,
which I spent almost entirely in the ISUG booth. Ruben Pillaca
Quispe was there from Peru with his Spanish language PowerBuilder
book, Breck Carter was there with his ASA 9 book, and Rob Verschoor
was there with his ASE books. It seems that the ISUG booth is still
primarily a draw for the ASE database folks as Rob was swamped and
there was quite a bit less interest in the ASA and PowerBuilder books.
There did seem to be more new vendors than last year, which is
another good sign.
LUNCHES
Like last year, the lunches were well done. Monday’s was a regular
sit-down in the same room used for the keynotes. Tuesday’s was in
the exhibit hall again, to encourage people to visit down there.
Wednesday’s was the PowerLunch back in the keynote room, where
you sat at tables devoted to a particular topic. And Thursday’s was
the box lunch. The only issue I had was that they were either rather
quick to pack up everything during the Tuesday lunch or they ran out
of food in many areas, because if you didn’t go back for seconds
quickly you didn’t get any.
SPECIAL EVENT
Universal Studios – everyone I talked to who went raved about it
(despite the rain at one point during the event). I’m a bit of a wimp
(given that I don’t like Pirates of the Caribbean, and Spiderman and
the Hulk are definitely out of my league), so I stayed back at the
hotel, reflashed SmartPhone 2003 on my Motorola MPx200 and
reconfigured it instead. I definitely need to get a life…(and a certain
Sybase product about to go into beta needs the 2003 version of
SmartPhone).
Wrap Up
All in all it was a well-done conference with a couple bumps and
a couple of areas that “need improvement.” They never did specifically tell us where we are headed for 2005, but with all the hints they
were dropping about gambling, my guess would be Las Vegas. See
you there! ▼
KEYNOTES
These could use a bit of work. I think the problem is that some of
the material they were trying to cover just doesn’t present well when
[email protected]
24
25A
25
26A
26
27A
27
28A
24
25A
25
26A
26
27A
27
28A
16
PBDJ volume11 issue 9
www.SYS-CON.COM/pbdj/
BE YOUR OWN
MOBILE SUPER HERO
WITH THE POWER OF
POCKET POWERBUILDER
YOU HAVE THE SKILL SET
LET SYBASE GIVE YOU THE POWER!
Got PowerBuilder? Go Mobile!
PowerBuilder® developers can easily leverage their expertise to create new
or extend existing applications using the Pocket.
Pocket PowerBuilder — a new rapid application development tool that speeds the
creation of mobile and wireless enterprise Pocket PC applications.
Go Mobile now with this limited time offer!
Purchase Pocket PowerBuilder today at $495. That’s more than 50%
savings. Checkout it out today at: http://eshop.sybase.com/eshop
©
2003 Sybase, Inc. All rights reserved. All trademarks are the property of their respective owners.
17
BOOK EXCERPT
PowerBuilder
Foundation Classes
Getting started
WRITTEN BY
WRITTEN BY
owerBuilder includes a powerful set of foundation classes to
speed development. These classes are collectively known as
the PowerBuilder Foundation Classes, or PFC. Part 1 of this
article provides an introduction to PFC and shows how to use
it. For the experienced PFC developer, I’ll outline the more recent
changes and additions to PFC in Part 2.
P
This article is not intended as a complete professional reference for
PFC – that could be (and is) the subject of an entire book on its own.
Nor is it intended as a tutorial, although there are code samples to
show you how to use some of the features. What you’ll find here is an
overview of the architecture, objects, and services of PFC so that you
can envision how to use PFC to make your applications more rich,
powerful, and user-friendly.
Getting Started with the PFC
What Is PFC?
PFC is a class library of precoded objects and behavior. PFC provides a head start to application developers as an “out-of-the-box”
class library solution.
PFC contains no prebuilt templates. It’s a set of base classes that
can be extended to provide a more powerful or specialized set of classes. It is a true “foundation” library. Sybase designed PFC with the intention that it would be extended, even though many developers find the
provided functionality of the PFC to be ample.
PFC is based on service-based architecture (SBA) and uses simple
function calls to enable services. The result is a foundation class library
with a great deal of functionality, flexibility, and reusability. It’s worth
noting, however, that the implementation of PFC uses layers of inheritance that tie many of the objects and references together and prevent
individual objects and services from being used without including the
majority of PFC objects in your application.
PFC provides basic windows, menus, and user objects. There are
also additional user objects that provide services for the developer to
use to enhance the functionality of any PFC application.
PFC is more than just the code; it’s a complete package. As shipped
with PowerBuilder 9, PFC includes:
• PFC Classes
• PFC Help
• PFC Sample Database
• Example program (located in the pfc\examples folder)
• PFC Start Wizard
• Tutorial
• Utilities: Library Extender, PFC Message Manager
What Is SBA?
PFC uses service-based architecture (SBA), which is a way of building relatively lightweight objects that delegate a great deal of function-
18
PBDJ volume11 issue 9
MILLARD
MILLARD F. BROWN III
ality to service objects. Windows and user objects create instances of
these nonvisual service objects and request functionality and processing from them. This maximizes the developer’s ability to reuse
and extend the service objects without needing to modify existing
objects and without having to carry around the overhead of fat
ancestor objects. See Figure 1 for how objects and services relate to
each other.
The traditional inheritance-based model of object construction utilized the capability of object-oriented (OO) languages to extend a base
object’s functionality by successively adding code in the descendants.
This was an improvement over the older “copy-book”– based reuse
model of non-OO languages, but there were some significant drawbacks. As the inheritance tree grew and different objects with slightly
different capabilities sprouted, it became increasingly difficult to
change behaviors, since where to put the new behavior in the inheritance tree was a critical question. In addition, the sheer size of the
objects gave rise to the term “fat ancestor.” A fat ancestor always carries along the overhead of all of its underlying code whether it needs it
or not. It loads slowly and (especially in the 16-bit environment of the
time) can cause the compiler to fail if it was too fat. Also, the developer
was forced to choose an object out of the hierarchy to fit whatever specialized use was required. If the developer wanted to change the use of
the object, it was necessary to replace it with another object from the
hierarchy, and painstakingly recode all of his changes.
SBA allows you to do more with less. The ancestor simply carries
“hooks” that allow it to make use of functionality contained in smaller, more efficient “service” objects. The service objects can be selectively enabled so that only those services that are actually needed are
instantiated. This reduces load time and memory usage. “Object
Choice” syndrome is eliminated – the developer uses a single base
object and instantiates services as needed to provide desired functionality.
PFC’s implementation of SBA uses instance variables in the PFC
objects to provide references to service classes. The service classes
are instantiated by calling a function, of_set<service>, that creates an
instance of the service and points the reference variable to the
instance. The general format for the naming of these reference variables is inv_<service> where <service> is an “English” name or shortcut for the service. For example, the instance variable declared in
pfc_u_dw for the linkage service is named inv_linkage. To instantiate
the linkage service on a u_dw control placed on a window, you would
write the following statement in the window open event:
dw_1.of_setLinkage(TRUE)
Placing the code for the linkage service in the window open event
ensures that all objects on the window have been fully instantiated.
In cases other than the linkage service (which depends on multiple
www.SYS-CON.COM/pbdj/
objects being fully instantiated) you would place the code to create a
service in the client object’s constructor or open event.
PFC Architecture
PFC is built as a set of visual and nonvisual objects with a layered design. PFC is based on two layers: the PFC and the PFE. Every
object in the PFC layer has a descendant in the PFE layer. The PFC
layer is where the actual code that implements PFC functionality is
placed. The PFE layer is left empty for the developer to modify and
extend as necessary. Objects in the PFE layer are named <object>
(for example, n_cst_dwsrv_linkage). Objects in the PFC layer are
named pfc_<object> (for example, pfc_n_cst_dwsrv_linkage). Figure
2 shows the PFC inheritance structure for a typical object, n_cst_
wnsrv_statusbar, the window status bar service. The PFC inheritance chain includes a “pfc_”-prefixed object and a non-prefixed
object for every step from the base object (pfc_n_base) to the statusbar service (n_cst_wnsrv_statusbar).
There are a few rules that go with PFC’s layered design:
• Never modify the PFC objects. Let me repeat, never modify the PFC
objects! If you do this, you’re simply creating migraine headaches for
yourself and anyone unlucky enough to inherit your application.
Keep all of your modifications in the PFE layer objects.
• Inherit from PFE-layer objects, not PFC-layer objects.
• Instantiate PFE-layer objects, not PFC-layer objects.
These rules allow the PFC-layer objects to be replaced as newer
versions and bug fixes are released without (for the most part) necessitating the recoding of the developer’s modifications and extensions.
Note that over time, especially at the transition between version 5 and
version 6, the PFC modifications were extensive enough that some
action on the part of the developer was required to properly migrate
applications to the new versions. There have also been some changes
to both the underlying operating system and the PowerBuilder compiler that have caused behavior changes in the underlying objects,
once again requiring minor changes to existing developer code. But
these slight hiccups have been relatively few, and the PFC-layered
architecture has proven to be quite stable as newer versions have
been released.
PFC is divided into 10 PBLs:
• pfcapsrv: PFC-layer application services
• pfcdwsrv: PFC-layer DataWindow services
• pfcmain: PFC-layer main objects and controls
• pfcwnsrv: PFC-layer window services
• pfcutil: PFC-layer utility and global objects and services
• pfeapsrv: PFE-layer application services
• pfedwsrv: PFE-layer DataWindow services
• pfemain: PFE-layer main objects and controls
• pfewnsrv: PFE-layer window services
• pfeutil: PFE-layer utility and global objects and services
The two-layer approach can be modified to suit your enterprise’s
needs. If you have extensions that you want to distribute at a departmental level (or across the enterprise), you can extend the PFC by
adding a MIDDLE layer (often called the PFD layer). Always add
extra layers in the middle of the inheritance hierarchy. The functioning of the PFC objects depends on the highest level objects (PFE)
having the name <object> without a prefix. What this means is that
you’ll actually interpose a new layer between the PFC layer and the
PFE layer. The objects in the PFE layer will no longer inherit from
the PFC-layer objects, but will instead inherit from your new “PFD”
objects. You (or some utility under your direction – see the discussion of the PFC Library Extender below) will need to modify the
source of the PFE objects to change the inheritance chain. Keep in
mind, though, that this introduces additional size and complexity to all
of your applications and that you can often accomplish a similar result
by creating new services and implementing those services in a stan-
www.SYS-CON.COM/pbdj/
Client class insubstantiates
service class only
as needed
Client Class
(Window or
User Object)
Service Class #1
Service Class #2
Service Class #3
FIGURE 1 | Functionality is redirected from the application object into the
PFC application manager.
dard way throughout the enterprise.
If you do choose to add a new
layer in the middle, you can use the
PFC Library Extender to do the hard
work of inserting new objects into
the inheritance hierarchy. The PFC
Library Extender is one of the utilities provided on the “Tool” tab of the
PowerBuilder “New” dialog. The
Library Extender uses a wizard to
prompt you through the steps
involved in adding a new layer.
PFC Major Objects and
Services
The PFC objects and services can
be broken down into the following
major categories.
PFC OBJECTS
• Application objects
• Window objects
• PFC controls
• DataWindow objects
PFC SERVICES
• Application services
• Window services
• DataWindow services
• Global services
The following sections provide an
overview of the objects and how they
interact.
pfc_n_base
n_base
pfc_n_cst_wnsrv
n_cst_wnsrv
pfc_n_cst_wnsrv_statusbar
n_cst_wnsrv_statusbar
FIGURE 2 | The PFC inheritance
chain includes a "pfc_"-prefixed
object and a non-prefixed object
for every step from the base
object (pfc_n_base) to the statusbar service (n_cst_wnsrv_statusbar)
PFC Objects
PFC APPLICATION OBJECT
The single most important PFC object is the application manager (n_cst_appmanager.) Each PFC application must have a global variable (gnv_app) declared as a reference to the application
manager.
n_cst_appmanager
gnv_App
PBDJ volume11 issue 9
19
Client class insubstantiates
service class only
as needed
Client Class
(Window or
User Object)
Service Class #1
•
•
Service Class #2
•
Service Class #3
FIGURE 3 | Functionality is redirected from the application object into the
PFC application manager
This global declaration should be the
only variable declaration of any type in the
application object. The
application manager is
used to contain variables and code that
might ordinarily be
placed in the application object. This provides a benefit in the
reuse and flexibility of
the code. An application object cannot be
inherited. This prevents a developer from
reusing any functionality that is placed in
the application. The
application manager is
a user object, so it has
no such restriction.
Figure 3 illustrates the
interaction between
the application, the
application manager,
and PFC service
objects.
PFC WINDOW OBJECTS
PFC Windows are
precoded with basic
functionality that
FIGURE 4 | The PFC has a large number of win- allows you to use
dows, all descendants of pfc_w_master.
other PFC services
easily and to provide
your target users with rich functionality with a minimal amount of
code. All PFC windows are descendants of the base window,
pfc_w_master. The primary PFC windows include:
• w_master: You don’t usually use w_master directly in your applications, but this is where you insert code that you would like to apply to
20
PBDJ volume11 issue 9
•
•
•
all windows across your application. W_master includes code to use
the Resize service and the Preferences service.
w_main: A window of type “main,” inherited from w_master.
w_child: A window of type “child,” inherited from w_master.
w_sheet: Use w_sheet for MDI sheets. This window, also inherited
from w_master, contains additional functionality for automatic display of microhelp.
w_frame: Use w_frame (or a descendant) as the frame window in
MDI applications. This window contains code to use the Sheet
Manager, Status Bar, and Toolbar services.
w_response: A window of type “response,” inherited from w_master.
W_response contains events that can be coded to implement functionality for response-window CommandButtons.
w_popup: A window of type “popup” inherited from w_master.
You will also find additional, special-purpose windows, such as
w_logon and w_sqlspy, in the PFC hierarchy. Figure 4 is a clip from the
PowerBuilder object browser showing part of the PFC Window hierarchy.
PFC CONTROLS
All of the common controls (such as single-line edit, multi-line edit,
and listbox) have pfc_equivalent standard user objects.
Standard PFC controls implement a variety of functionality, including:
• Cut, Copy and Paste: Editable controls only.
• Popup (right-mouse button) menu: Enables RMB commands including cut, copy, and paste.
• Autoscroll: Scrolls the list automatically as the user types. Implemented
on DropDownListBox and DropDownPictureListBox.
• Autoselect: Selects the text within an editable control when the control receives focus.
• MicroHelp: Displays a tag value in the MDI microhelp area when the
control receives focus.
Table 1 lists the standard visual user objects for PFC versions of
common controls.
In addition to the standard controls, PFC gives you some advanced
controls:
• u_dw – the DataWindow control: This control provides enhanced
capability, including integration with the PFC menus, the linkage
service, and the Logical Unit of Work (LUW) service for managing the
save cycle.
• u_lvs – service-based listview: This control enhances and simplifies
the use of the ListView control. The DataSource service provides the
capability for display and update of data in a ListView, and the Sort
service lets you provide column-header sorting capability in the
report view.
• u_tvs – service-based TreeView: Enhances and simplifies the use of
the TreeView control. U_tvs uses the LevelSource service to display
and update database data in the control.
• u_tab – Tab Control: Includes code to use the Resize service.
• u_tabpg – tab page control: Use this user object as the ancestor for
your tab page controls.
• u_calculator – a calculator control: Can be used as a dropdown calculator in a (u_dw) DataWindow column or an editmask, or as a
standalone calculator
with an editmask.
PFC User Object Control
• u_calendar – a calendar
u_ddlb
DropDownListBox
control: Can be used
u_ddplb
DropDownPictureListBox
with date columns on a
u_em
EditMask
u_dw-based
u_mle
MultiLineEdit
DataWindow, or with a
u_oc
OLE Custom Control
date value EditMask.
u_rte
RichTextEdit
• u_st_splitbar – a
u_sle
SingleLineEdit
SplitBar control: Place
this between two other
controls to allow the user Table 1 | PFC Standard Visual User Objects
www.SYS-CON.COM/pbdj/
©2003 Sybase, Inc. All rights reserved. All trademarks are the property of their respective owners.
4GL RAD Tools
POWERBUILDER
THE CLASSIC,
TRIED-AND-PROVEN
CLIENT/SERVER
DEVELOPMENT TOOL.
POWERBUILDER
THE HANG-ONTOYOUR-SEAT
CLIENT/SERVER
DEVELOPMENT TOOL.
For years, PowerBuilder® has reigned
Take your client/server applications
as the premier development tool
to the next level with the
for client/server applications. Our
PowerBuilder Native Interface.
newest iteration extends both our
Integrate your existing and new
leadership and your investment
PowerBuilder applications with
in skills and applications for
C and C++ applications. And
client/server development. There’s
easily work with J2EE and .NET
a host of exciting new features.
components and applications
Download all the technical details
exposed as Web Services. Details
at sybase.com/powerbuilder.
at sybase.com/powerbuilder.
INFORMATION LIQUIDITY.
SYBASE INTEGRATION TECHNOLOGIES.
E V E R Y T H I N G W O R K S B E T T E R W H E N E V E R Y T H I N G W O R K S T O GPBDJ
E T Hvolume11
E R TM
.
issue 9
Service Type
Application
Window
DataWindow
Global
Global
Autoinstantiate
Scope
Application
Window
Control
Object
script
object
Autoinstantiate
script
Where to Instantiate
gnv_app open event
Window open event
u_dw constructor event
object constructor event
script
instantiated upon declaration of instance
variable
instantiated upon declaration of local
variable
PFC DataWindow
Service
Basic
Description
You don’t need to explicitly instantiate the
Base services if you are using any other
DataWindow services.
DropDown
of_setDropDownCalculator Enables a dropdown calculator for
Calculator
DataWindow columns.
Filter
of_setFilter
Displays a filter dialog to the user and
applies the filter.
Find
of_setFind
Displays a Find dialog to the user and
searches the DataWindow according to
user input.
MultiTable
of_setMultiTable
Allows updating of multiple tables from a
Update
single DataWindow.
PrintPreview
of_setPrintPreview Provides PrintPreview capabilities: Display,
Navigate (first page, last page, previous
page, next page), and zoom.
QueryMode
of_setQueryMode Simplifies DataWindow Query Mode
operations.
Required Column of_setReqColumn Allows you to defer required column
processing until the user completes data entry.
Resize
of_setResize
Resizes DataWindow columns when the
user resizes a window.
Row Manager
of_setRowManager Allows insertion and deletion of rows and
includes an undo function for deletions.
Sort
of_setSort
Provides enhanced sorting dialogs and
column-header sorting.
Table 2 | Instantiating PFC Services
PFC Window
Service
Basic
Instantiation
of_setBase
Description
Basic Window services. You don't need to
explicitly instantiate the Base services if
you are using any other Window services.
Logical Unit
instantiated by
Manages the save cycle for selfof Work (LUW) default in
updating objects. A self-updating object is
pfc_w_master
an object that implements an interface
defined by the following functions:
of_acceptText, of_updatesPending,
of_validation, of_updatePrep, of_update,
and of_postUpdate
Preference
of_setPreference
The preference service saves window
settings, specifically size, position and
Toolbar settings.
Sheet
of_setSheetManager Manages multiple sheets in an MDI
Management
application. The sheet management
service enables the "Minimize All
Windows" and "Undo Arrange Icons" items
on the Window menu. Enable the sheet
managment service on the frame window
of your MDI application.
Status Bar
of_setStatusBar
Displays date, time, and memory information on the status bar. Also implements
progress-bar and user text features.
Table 4 | PFC DataWindow Services
•
•
Table 3 | PFC Window Services
•
to resize the surrounding controls simultaneously.
• u_progressbar: A programmable vertical or horizontal progressbar
control.
•
PFC Services
INSTANTIATING PFC SERVICES
Instantiate PFC services within a program by coding a statement of
the form
of_set<service>(TRUE)
in the object where you want to use the service. Replace <service> in
this statement with the name or shorthand that designates the service. Exceptions to this rule are the services that are defined as
autoinstantiate objects. Instantiate these objects by declaring a
variable of the type of service object either as an instance variable
or as a local.
Where is the best place to place the call to of_set<service>? Table 2
lists the service categories, your intended scope, and the place to
instantiate the service.
Instantiation
of_setBase
retained, which eliminates repeated retrievals. This is especially useful for dropdown DataWindows containing reference data (such as a
table of U.S. states).
Debugging: A service that allows logging, SQL debugging (SQL Spy),
and application logging.
Security: A comprehensive, object- and control-based security system. PFC Security gives you atomic control of security – down to the
level of individual window controls DataWindow columns, and even
menu items.
Error Message Processing: A service to manage your application’s
error messages. The error service allows you to format and display
error messages, log messages, and generate automatic notifications
via e-mail.
Transaction Registration: A service to keep track of transactions for
applications that use more than one transaction.
PFC WINDOW SERVICES
The window services included in PFC are summarized in Table 3.
PFC DATAWINDOW SERVICES
PFC provides DataWindow services that greatly enhance the richness of functionality available to the user and developer. Some of the
PFC DataWindow services are summarized in Table 4.
PFC GLOBAL SERVICES
Some of the services provided by the PFC aren’t categorized in any
particular way. They can be used in a variety of situations and perform
useful utility functions. These are called the PFC Global functions.
Some of the global functions provided by PFC are listed in Table 5.
Using the PFC
PFC APPLICATION SERVICES
PFC application services are designed to be scoped at the the application level, and should be instantiated in the application manager,
gnv_app. The application services are:
• DataWindow Caching: Allows often-used static data to be cached for
quicker display. The cached data comes from a single source and is
22
PBDJ volume11 issue 9
THE PFC START WIZARD
The easiest way to create a PFC application is through the use of the
PFC Start Wizard. Make sure you have a valid workspace open and
select “new” from the menu. This will bring up the PowerBuilder New
dialog. Select the Target tab and choose “Template Application.” Figure
5 shows the New dialog with the Target tab selected.
www.SYS-CON.COM/pbdj/
PFC Global
Service
Instantiation
Resize
of_setResize
Description
Used to resize controls on Windows, Tabs and
Tab Pages when the enclosing object is resized.
Conversion Autoinstantiate Provides functions that you can use to
n_cst_conversion convert values from one data type to another.
Date/Time
of_setDateTime Provides functions to manipulate and perform
calculations upon date and datetime values.
File
global function Provides platform-specific functions to
f_setFile
manage files and folders.
Platform
global function Adds platform-specific functionality to your
f_setPlatform
application.
SQL Parsing autoinstantiate Provides functions to parse and reassemble
n_cst_sql
SQL statements.
String
autoinstantiate Provides functions for string operations, such
n_cst_string
as parsing, global replacement, manipulating
case, and others.
List Service autoinstantiate Implements various types of lists: basic, stack,
n_cst_list
queue, and tree.
Table 5 | PFC Global Services
FIGURE 5 | The PFC Start Wizard is initiated from the New Target dialog.
Click OK and the Wizard will start. You’ll see a confirmation screen.
Click Next, then you’ll see an explanatory dialog that tells you what
steps the wizard will take. Click Next. In the next screen, type a name
for your application, such as “pfc_newapp”. Be sure to check that the
paths for the application library and target have been set correctly. A
good way to organize your applications is to keep the workspaces and
targets in a “Workspaces” folder and keep the application libraries in a
folder under the Workspaces folder. Name the application folder
“pfc_newapp” as well. Click Next.
The next screen presents three choices: MDI application, SDI application, or PFC-based application. Choose PFC-based application and
click Next. The next screen requires you to add the PFC libraries to the
target’s library list. Simply point to the PFC libraries under the
PowerBuilder folder, or make your own copies, possibly in a PFC
folder under the Workspaces folder. If you are developing in a networked environment, it’s important that you use a local copy of the
PFC PBLs (as well as all of your application’s PBLs). See the section
entitled “The Need for Speed” for further information on this point.
You must include all 10 PFC libraries in the list. Do not include the
library called pfc_app.pbl. This library is used by the wizard but is
not required in your application. Once you’ve selected the PFC
libraries, click Next.
The next screen lets you choose whether or not to create a project for the executable. If you choose Yes, you’ll need to:
• Name the project.
• Provide a name for the executable application.
• (Optional) Provide the name of the .pbr (resources) file for the application. This is the file where you add names of images and such
that you want included in the executable.
• Choose build options. Overwrite executable, full versus incremental build. (For the best stability, choose full build. For build speed,
choose incremental build.)
• Choose whether to generate machine code. Except in very special, compute-bound circumstances, you should not generate machine code.
• Build Dynamic Libraries (PBD). This is usually a very good idea.
Check this box.
• Enter application identification and version information. This is for
your use and should include identifying information for your company and the product as well as copyright and version information.
If you choose to not create a project you can skip this step and
create one at a later time.
Once you’ve chosen your project options, you’ll see the final screen
for the wizard. If you want PowerBuilder to provide you with a quick
start TODO list, leave “Generate TODO List” checked. This will give
you a list of scripts and objects that need to be added to your application. It’s a good idea to use the TODO list at first. Figure 6 shows the
TODO list produced by the PFC Start Wizard.
Notice that some precoded scripts are provided in the pfc\wizsrce
folder. Use these scripts as directed by the items in the TODO list to
populate events in the application manager. In addition, the TODO
list directs you to create a few windows and objects. Believe it or not,
once you’ve done the steps in the TODO list, you’ll have a working
PFC application. Of course, that application won’t accomplish much –
that awaits your artful use of the other PFC objects. ▼
AUTHOR BIO
Millard F. Brown is vice president of Power3, LLC, a company providing consulting and training services
for the enterprise. He has been developing PowerBuilder applications since PowerBuilder 2 and is the coauthor of two PowerBuilder 9 books: PowerBuilder 9: Advanced Client/Server Development and
PowerBuilder 9: Internet and Distributed Application Development.
• • •
This article is based on PowerBuilder 9: Advanced Client/Server Development by various
authors (ISBN 0672325004), published by Sams Publishing. Also look for PowerBuilder 9
Internet and Distributed Application Development.
FIGURE 6 | The PFC Start Wizard builds a TODO list to help you get started
with your PFC application.
24
PBDJ volume11 issue 9
[email protected]
www.SYS-CON.COM/pbdj/
Power Puzzle
Answers:
page 34
Across–––––––––––––––––––––––––
1. Packaging related data and procedures in
an object.
6. Signed numbers with up to 18 digits. You
can place the decimal point anywhere
within the 18 digits.
9. A handle used to access an object
instance.
12. A key used in combination with another
key that allows you to select a control or
menu item.
16. The feature that enables you to build
windows, user objects, and menus that
are derived from existing objects.
21. A standard number datatype that is a
signed floating-point number with 15
digits of precision.
22. Text displayed whenever the pointer
pauses over a toolbar button that tells
you what the button is for
23. An ASCII file that contains the name of
each file in which a resource that is
assigned dynamically in scripts in the
application is stored. These resources can
include bitmap, icon, and cursor files.
24. A key composed of a column or set of
columns that contains primary key val-
www.SYS-CON.COM/pbdj/
ues from another table. Each item in the
column or columns must correspond to
an item in the column of the other table.
Down–––––––––––––––––––––––––
2. A programming language’s ability to
process objects differently depending on
their datatype or class. The ability to
redefine methods for derived classes.
3. A variable that belongs to an object definition, exists across all instances of the
object, and retains its value when an
object is closed and opened again.
4. An application in which users work with
one main window at a time to perform
an activity (although that window may
display various popup or child windows
to do supporting chores as a user works).
When users want to perform a different
kind of activity, they go to a different
main window to do it.
5. The base class from which all
PowerBuilder system objects are
descended.
7. A function call made by a client that
instructs the server to perform processing immediately.
8. An object that defines basic functionality
for a class of objects from which descendent objects inherit.
10. A standard number datatype that is a
signed floating-point number with six
digits of precision.
11. Another menu that appears when an
item on a dropdown menu is selected.
13. A variable that is accessible anywhere in
the application. It’s independent of any
object definition.
14. A key composed of a column or set of
columns that uniquely identifies each
row in a table.
15. A window that requests information from
the user and to which the user must
respond (application modal).
17. Integer variables used to identify NULL
values or conversion errors after a database retrieval.
18. Code that can be transmitted over a network and then executed on a recipient’s
computer.
19. Where a variable or function name is recognized (local, global, or object).
20. A datatype that is used to store an
unbounded amount of data (for example,
generic binary, image, or large text).
PBDJ volume11 issue9
25
ON PAR
What Happened to Tiger?
Is it happening to you?
WRITTEN BY
MIKE DEASY
iger Woods is, arguably, one of the
finest golfers ever to pick up a
club. During his peak a few years
ago, it really did not seem as if anyone
would ever beat him. He dominated the
game, dominated every player he came
up against. He was an invincible force.
I asked a buddy once why he and his
fellow duffers thought Tiger was so
amazing. He said it was because there
just weren’t any holes in Tiger’s game,
that Tiger was complete in all respects.
T
I also know that Tiger practiced,
hour after hour. Long after darkness
had come on and the other golfers had
called it a night, Tiger would hit balls
into garbage cans under lights. When
everyone else had given up, he continued to strive for excellence. Now, Tiger
hasn’t won a major tournament in several years – he is no longer dominant,
he is really no longer a threat.
not the right move for everyone.
Sometimes, you can’t beat the triedand-true tools that have gotten you to
where you are. And, while it is decidedly
very important to keep your skill set as
current as possible, this is not always
the way to stay at the top; sometimes, it
makes more sense to hone the skills you
already have. Perhaps Tiger should go
back to the old clubs.
Tiger got the girl: Yeah, okay, so most
of us did not land sexy, Swedish models as a result of our dedication to
PowerBuilder. On the other hand,
many of us did end up with a family.
And, when you have created a family, it
make it happen. I think spending time
with family is more balanced.
Tiger does Buick commercials: Again,
our professions in PB have not landed
most of us in the media. But, being an
IT pro has given me, and many of you,
an excellent and easy means of picking
up some side jobs. Unfortunately, as we
take on a little Web development, or do
a little consulting work on the side, we
can lose track of our monster drives,
our great putting, and our short games.
Essentially, Tiger does more than golf:
While many of us fall victim to the pitfalls of growing into new stages in our
So what happened?
Tiger got rich: And some of us made a
little money as well. It is interesting how
money can change your perspective on
work. It diminishes some of the hunger
that you might have felt during your
misspent youth as a young coder. Now,
you have been working for a number of
years, you’ve got some money in the
bank, and the motivation to stay late
just to put the finishing touches on that
app is not as strong. Some say Tiger lost
AUTHOR BIO a certain amount of his competitive
Michael Deasy is an drive because of the money; maybe we
applications specialist with do the same in IT.
the State of Washington.
He has been working Tiger changed clubs: Since the switch to
with PowerBuilder since Nike, Tiger has not done nearly as well.
version 3. Mike holds an Similarly, while many of us tried to conMBA from Southern vert ourselves into Flash programmers
Nazerne University. or hot shot Web developers, this was
26
PBDJ volume11 issue9
is really quite normal to want to get
home at the end of the day. There is
never a night when I think of being at
work as a better or more productive
way to spend my time than to be home
with my wife. Somehow, during my
most productive time as an IT professional, I would work monster hours to
professional careers, it is apparent that
the balance of our lives falls on the side
of life outside the cubicle. And, while
we may break our string of Majors
because of it all, who among us can cast
a stone? Tiger has a life!! ▼
[email protected]
www.SYS-CON.COM/pbdj/
YOUR FASTEST ROUTE TO POWERBUILDER DEVELOPERS
• Each issue is devoted exclusively to
the newest aspects of PB development
using version 9.0, Pocket PB 1.0,
PowerDesigner 9.5.2,
iAnywhere Solutions, etc.
• Written by acknowledged PB and
EAServer experts
• Published monthly, circulated
worldwide - the world's first and
leading PowerBuilder print and
online resource
• Now in its 10th year !
www.sys-con.com/pbdj/
For more details contact
Carrie Gebert
201 802.3026
[email protected]
POCKETBUILDER
PocketBuilder Application
and UI Design
WRITTEN BY
IAN THAIN
Do’s and don’ts of mobile development
his article points out specific
areas for Pocket PC and
Smartphone application development and user interface
design with PocketBuilder. This isn’t a
million miles away from the older
client/server techniques, but there are
some specific areas that need to be
discussed for the currently available
Windows mobile devices (Pocket PC,
Pocket PC Phone Edition, and
Smartphone).
T
Performance
Windows mobile devices have the
same performance issues as client/
server or UI that fall into the area of
responsiveness. User-focused storyboards should be used to help measure
areas of performance. These performance areas usually show that the UI
also needs to execute as quickly as possible on start up and all windows need
to paint rapidly, showing any data that
may be needed.
In the area of Windows mobile hardware there are separate performance
issues to be accounted for. First, the
Pocket PC devices have faster processors, the current being the Intel PXA270
624MHz in the Dell AXIM X30 (see
Figure 1). They also have persistent
RAM storage, which is battery backed
and goes into a standby mode when not
in use. The Smartphone has a slower
processor, Texas Instruments OMAP 710
120MHz, permanent flashed storage,
and less RAM due to cost pressure, and
is idle when not in use.
Power
AUTHOR BIO
Ian Thain is a technical
evangelist and software
engineer at Sybase Inc.
He has been using
PowerBuilder since v2.0,
EAServer since v3.0, and
Pocket PowerBuilder
since its beginning.
28
Current Pocket PC devices come
with exchangeable batteries that lie
between 900 mAh Lithium-Ion and
1800 mAh Lithium-Ion and, for the
highest power batteries, supply an average of 14 hours of normal use without
usage of WiFi and Bluetooth.
The key areas for limiting power
consumption lie within the CPU and
PBDJ volume11 issue 9
peripheral utilizations. For CPU utilization, fast and efficient code is needed as
executing heavy code uses more power.
To control peripheral utilization, such
as WiFi, Bluetooth, IR, USB, etc., developers should close peripheral handles
when not needed. Avoiding polling
saves up for bulk usage, and WiFi uses
efficient protocols as more power is
used when sending bytes.
When you are idle, try to avoid
unnecessary processing and animations. You can stop unnecessary processing by coding LoseFocus or
Deactivate when your app is overlapped
by another active process. Disable
timers if possible. The aim is zero use
by the user, zero use of CPU, and maximum power conserved.
Memory and Storage
Tahoma 8 point is usually the best on a
Windows mobile device.
Other overall design principles
include the use of the 80/20 rule: optimize the UI for 80% of the cases and
support the remaining 20% in other
ways, for example, menus or other
dialogs. In other words, bring the most
important information to the main
view of an application. The rest of the
information should be one step away.
Use audio as a UI cue, not a novelty
item. Place frequently needed controls
at the top of the dialog box; information should flow top-down and left to
right.
Reduce redundancy by promoting
one way to do things and avoid options.
Instead, figure out the best way to do it.
Let the user “learn once, do everywhere,” and design for performance.
On a Pocket PC, RAM performance
is fast and has a low overhead for the
speed of an application, whereas
Smartphone memory has persistent
storage and is slower. Your applications
must be designed to be tolerant of slow
storage and not save too much data,
and especially persistent when coding
for a Smartphone.
Pocket PC UI
In the user interface the big difference is that there is no multiple document interface (MDI), just a single document interface (SDI). To compound
that we have the reduced size of the
Windows mobile device screen, 80–85%
less for Pocket PC and smaller for the
Smartphone. The best way to solve this
is a tabpage approach where the application allows users the functionality
that’s similar to what they would be
used to on a Windows desktop (see
Figure 2).
Use the notification bubble for persistent notifications that don’t stop processing, such as a messagebox, but also
don’t use them where messageboxes
should be used. Standardize on a font;
FIGURE 1 | WM2003SE device and
Smartphone
FIGURE 2 | Tabpage UI
www.SYS-CON.COM/pbdj/
$198.00
*
(
FREE CD! VALUE!)
PBDJ ADVERTISER INDEX
ADVERTISER
URL
PHONE
PAGE
Secrets of the Java Masters
Active Endpoints, Inc.
www.active-endpoints.com
203-929-9400
2
Every JDJ Article on One CD!
Amyuni Technologies
www.amyuni.com
866-926-9864
33
Assande
www.assande.com
ClearNova
www.clearnova.com/thinkcap
770-442-8324
15
E.crane
www.ecrane.com
603-226-4041
36
iAnywhere
www.ianywhere.com
800-801-2069
35
Web Services Edge Expo
www.sys-con.com/edge
201-802-3066
31
IT Solutions Guide
www.sys-con.com/IT
201-802-3020
23
PowerBuilder Developer's Journal
www.sys-con.com/pbdj
201-802-3026
27
Sybase
http://eshop.sybase.com/eshop
877-230-6771
17
Sybase
www.sybase.com/pbextension
877-230-6771
11
Sybase
www.sybase.com/powerbuilder
877-230-6771
7, 21
Sybase
www.sybase-iad-services.com/30081a 877-230-6771
9
— The Complete Works —
CD is edited by JDJ Editor-in-Chief Alan Williamson and organized
into 33 chapters containing more than 1500 exclusive JDJ articles!
All in an easy-to-navigate HTML format! BONUS: Full source code included!
5
ORDER AT WWW.SYS-CON.COM/FREECD
*PLUS $9.95 SHIPPING AND PROCESSING (U.S. ONLY )
©COPYRIGHT 2004 SYS-CON MEDIA. WHILE SUPPLIES LAST. OFFER SUBJECT TO
CHANGE WITHOUT NOTICE. ALL BRAND AND PRODUCT NAMES ARE TRADE NAMES,
SERVICE MARKS OR TRADEMARKS OF THEIR RESPECTIVE COMPANIES.
Only from the World’s Leading i-Technology Publisher
www.SYS-CON.COM/pbdj/
Advertiser is fully responsible for all financial liability and terms of the contract executed by their
agents or agencies who are acting on behalf of the advertiser. This index is provided as an additional service to our readers. The publisher does not assume any liability for errors or omissions.
PBDJ volume11 issue 9
29
Microsoft Guidelines
FIGURE 3 | SIP overlay and PocketBuilder
FIGURE 4 | WM2003SE in landscape
FIGURE 5 | PocketBuilder and orientation change
The application’s title must be displayed on the NavBar. Applications must
not use the NavBar for anything application specific. Use system support if
implementing a full screen mode.
Display New and SIP Buttons only in
standard locations. SIP should be displayed continuously and hidden only
where no input is possible, and the
menu leftmost and the buttons rightmost – this isn’t an issue at the moment
as we don’t mix buttons with menus
with PocketBuilder. No file menu item,
although I prefer having a file menu
when necessary. Common menu items
must appear in order, such as Edit, View,
Insert, Format, and Tools. Common buttons must appear in order, such as New,
Open, Save, and Print. Tooltips should
be on all command bar controls; no
underlined accelerators in menus or
dialogs and no shortcuts in menus. No
user-exposed method for closing the
application, although I prefer having an
explicit “exit.” Each application should
have 16x16 and 32x32 icons so they can
be displayed by the OS. Applications
must support long filenames and common dialog boxes for saving and opening files.
Do not duplicate the functionality of
the notification system, POOM object
model, phone API, and telephony API
(TAPI).
Applications must use the connection
manager to configure connectivity
options. Display the standard wait cursor
for unresponsive events. There is no help
tool button or help item on the menu bar,
though I prefer this. Help systems should
be integrated with the system TOC.
Applications must not assume there
is external storage, and they must
respect user settings. Applications must
shut down gracefully and not display
any dialog boxes or other UIs, due to the
fact that applications will be shut down
by the shell. State should be restored
when starting. There should be only one
instance executing.
Applications must handle the
appearance and disappearance of SIP.
Text fields must be accessible with
SIPUp, and partial screen dialogs must
not be overlayed by SIP.
How PocketBuilder Can
Handle a SIP Overlay
One way to approach this with
PocketBuilder is with a user object
panel or DataWindow to hold the controls on your window (see Figure 3).
Let’s look at how this can be achieved.
On the GetFocus event of the entry
fields store an identifier for that field in a
variable and also code SetSIPPreferredState
to SIPUp. In the application window within
the SIPUp event, trigger another event. In
this event code, if the field is one that
would be overlaid by SIP, calculate the top
position of SIP and resize the user object to
the remaining height, thus showing a
scrollbar and moving the field above SIP.
In the application window SIPDown
code use the opposite functionality to
put the panel or DataWindow back in its
proper place (see Listing 1).
WM2003 – Second Edition
The main features of this latest OS
release from Microsoft are the support
for landscape orientation (see Figure 4),
VGA screen resolution, and a square
screen. With this release of WM2003 we
have to support:
• Portrait: 240x320
• Landscape: 320x240
• Square: 240x240
It should be noted that an application cannot change portrait to square,
or vice versa. A hardware button or a
certain way of opening the device in the
case of the Motorola MPX device can
initiate this change. Within the emulator
application button #2 will initiate a
change of orientation.
While discussing emulators, it’s
worth mentioning that with WM2003 SE
we have 14 in total, 12 for the Pocket PC,
and 2 for the Smartphone. These will be
supported in PocketBuilder v2.0.
How PocketBuilder Handles
Orientation Changes
FIGURE 6 | Calendar portrait
30
PBDJ volume11 issue 9
FIGURE 7 | Calendar landscape
When the display orientation is
changed, there are a couple of “resize”
events, a PBM_SETTINGCHANGE event,
and then another “resize” event. What you
need to code as a PocketBuilder developer
is within the “PBM_SETTINGCHANGE”
event. This is where you can programmatically move and size the controls.
How would you know where to move
and resize these controls? The best
www.SYS-CON.COM/pbdj/
advice would be to inherit from your first
window, then change the size (for example, 240x320 pixels to 320x240 pixels,
portrait to landscape). Then you can read
off the properties you need from within
the IDE. Is that painful enough for you?
Another approach is to use that
same ancestor window. This provides
the opportunity to take the existing window design and graphically change it to
the other orientation, at the same time
changing the design as mentioned later
in this article.
With this approach the problem is
that you need to be sure that variables
and properties are persisted between the
transitions from one window orientation
to the other. This is due to the fact that
we will need to open the second window, the window you are changing to,
then populate it to the state of the first
window. Only then can we change the
first and, hey, presto, the second window
becomes our new main window for the
application (see Figure 5).
Splitting out any business logic will
probably be second nature to you
PowerBuilder developers who follow
object-oriented design, but the visual
controls, etc., may be another matter.
What I created was an orientation service object that works with controls that
are registered with it and reloads the
properties you want with the window
you are transitioning to.
DataWindows or DataStores are even
easier, as they can be populated from a
ShareData call with a DataWindow or
DataStore in your business logic object
(see Listing 2, which can be downloaded
from www.sys-con.com/pbdj/sourcec.cfm).
Content and Layout
There are three redesign options for
WM2003 SE when redesigning a main
window from one orientation to the other.
The first option is to fit the content
to the new window. In this way, you as
the developer should display the content and format the data the same for
both ways. The calendar is a good
example. In both orientations it still
shows 36 days, but the cells become rectangular (see Figures 6 and 7). From the
user’s perspective, the interface is the
same, so this is an ideal solution.
The second is to change the content
to fit the new window. Again the calendar is a good example. When looking at
the year view you can’t show all 12
months in the calendar and shrinking
the window design is impossible without destroying the user experience
The third is to change the new layout
totally. This is the best situation when
you cannot fit or change the design.
Media player is a great example of this.
Whatever the orientation of the window,
the screen size must stay large, so the
layout needs to change.
For dialogs it’s slightly different and
easier. Dialogs should be designed for a
square, which is 240x240 pixels, and
should fit in all orientations without
scrollbars. With this approach white
space is a byproduct.▼
[email protected]
Listing 1
tab_1.tabpage_uo.uo_1.vscrollbar = TRUE
//ue_sipup_uo code
long left = 0, top = 0, right = 0, bottom = 0
Integer li_pbbottom
Integer li_bottom
//WM_SCROLL to position of control
Send(Handle(tab_1.tabpage_uo.uo_1), 277, 7, 0)
END IF
ii_height = tab_1.tabpage_uo.uo_1.height
if tab_1.tabpage_uo.uo_1.ii_control > 6 THEN
//Get positions of Window Rect
GetDeskRect(left, top, right, bottom)
li_pbbottom = PixelsToUnits(bottom,
YPixelsToUnits!)
//Subtract Menu
li_pbbottom = li_pbbottom - PixelsToUnits(26,
YPixelsToUnits!)
tab_1.tabpage_uo.uo_1.resize(
tab_1.tabpage_uo.uo_1.width , li_pbbottom )
//Get positions of SIP Rect
GetSIPRect(left, top, right, bottom)
//ue_sipdown_uo code
IF IsNull(ii_height) or ii_height = 0 THEN
//Ignore...a SIPDOWN has probably been sent before
a SIPUP
ELSE
tab_1.tabpage_uo.uo_1.resize(
tab_1.tabpage_uo.uo_1.width , ii_height )
//WM_SCROLL to SB_TOP
Send(Handle(tab_1.tabpage_uo.uo_1), 277, 6, 0)
tab_1.tabpage_uo.uo_1.vscrollbar = FALSE
END IF
DOWNLOAD THE CODE!
www.sys-con.com/pbdj/
~continued from page 4~
Euphemisms
•
•
•
•
Working late
Being unappreciated
Flipping burgers
Sleeping
communication skills for our customer-focused cutting-edge
projects. Candidate must also be an excellent troubleshooter
and able to work in a fast-paced environment.
In addition to offering valuable experience, we offer an
exciting, ethnically diverse working environment and celebrate diversity. Creative benefit package available. Equal
Opportunity Employer.
that just about any other job looks attractive.
PUTTING IT ALL TOGETHER
With the euphemisms out of the way, the following job
ad makes more sense.
ABC Corporation is seeking a self-starter with strong
32
PBDJ volume11 issue 9
FINAL THOUGHTS
I hope you enjoyed my tongue-in-cheek view of the
improving job market. If you have a euphemism of your
own, I would love to hear it. ▼
[email protected]
www.SYS-CON.COM/pbdj/
PowerBuilder News
All things of interest to the PB community
BY BRUCE ARMSTRONG
[email protected]
THIRD-PARTY TOOLS
GWEN
Initial development work has
started on GWEN. GWEN is an
acronym for the GlobalWare
Enterprise Nucleus, a toolkit and
remote management console for
Caché database applications. The
project uses a PowerBuilder front
end hosted over the Web through
the Windows ActiveX control.
http://gwen.sourceforge.net/
POWERBUILDER
PowerBuilder 10.0 Released
7/25 – Sybase released
PowerBuilder 10.0, which introduces a number of new features
including Unicode support, the
XML DataWindow (a revised version of the HTML DataWindow
implemented through CSS, XSLT,
and XML), and refactoring support through the integration of
PowerDesigner object modeler
into the PowerBuilder IDE
through a plug-in interface. More
information on the product,
including a downloadable evaluation version, is available at:
www.sybase.com/products/internetappdevttools/powerbuilder.
DataWindow.NET 1.0 Released
7/25 – Sybase released
DataWindow.NET 1.0, an implementation of the PowerBuilder
DataWindow, DataStore, and
Transaction classes as .NET components. More information on the
product, including a downloadable
evaluation version, can be found at:
www.sybase.com/products/internetappdevttools/datawindownet.
locate and determine the availability of critical resources using Wi-Fi
wireless network-based infrastructure, thereby improving asset utilization and enhancing service
quality.
The Sybase mobile real-time
RFID solution, which supports
relational database management
systems such as Adaptive Server
Enterprise and SQL Anywhere
Studio, aggregates location data
from AeroScout’s active RFID solution, as well as other passive RFID
sources, and delivers it to mobile
devices such as smart phones and
PDAs, including Palm and
PocketPC.
Beta Program for Next Generation Enterprise-Class RDBMS
8/16 – Sybase announced the beta
release of Sybase Adaptive Server
Enterprise 15.0, the company’s
enterprise-class relational database management system
(RDBMS). Developers are invited
to join the ASE 15.0 beta program
to get ahead of the curve by evaluating and testing the new version’s
expanded data management
capabilities, receive in-depth
implementation advice, and
ensure that their valuable feedback is incorporated into the final
feature set. All Tier One participants will receive a free copy of
Rob Vershoor’s “The Complete
Sybase ASE Quick Reference
Guide.” Additional product and
beta registration information is
available online at:
www.sybase.com/ase15.0beta.
Earnings Release
CORPORATE
Integrated Wi-Fi Location and
Active RFID Tracking Solution
8/16 – Sybase and AeroScout, a
Wi-Fi standards-based enterprise
visibility solutions provider,
announced the availability of a
mobile real-time RFID tracking
solution. The combined solution
allows organizations to quickly
34
PBDJ volume11 issue 9
7/22 – Sybase reported total revenues of $188.0 million for the 2004
second quarter ended June 30,
2004, versus total revenue of $192.0
million for the 2003 second quarter.
iANYWHERE
iAnywhere Named Number One
8/17 – In a recent report,
“Worldwide Mobile Device
Management Enterprise 2003
Vendor Shares,” IT market research
advisory firm IDC recognized
iAnywhere Solutions, Inc., a subsidiary of Sybase, Inc., as the leader
in mobile device management
enterprise software with higher
revenues and market share than
nearly 20 competitors. The results
in this year’s report reflect the
acquisition of XcelleNet by Sybase
in May 2004 and mark the third
consecutive year that the XcelleNet
Afaria product has led the MDM
Enterprise software market.
IDC expects the MDM
Enterprise market to reach a compound annual growth rate of 44.9
percent through 2008, reaching a
total of $911.4 million. As defined
by IDC, the Mobile Device
Management Enterprise software
provides standard features found
in all desktop administration solutions, such as maintaining PC
hardware and software inventories, performing software distribution, managing antivirus scan files,
and enabling remote control for
systems diagnostics.
Security Manager for
Smartphones
7/12 – iAnywhere Solutions, a subsidiary of Sybase, announced
XcelleNet Afaria Security Manager
for Windows Mobile-based
Smartphones. Extending its
award-winning and proven support for a diverse array of frontline devices and platforms, this latest release establishes Afaria as the
only solution that addresses security and device management for
Smartphones, handheld devices,
laptop computers, and tablet PCs
from a single console.
Defense (MOD) project to revolutionize its battlefield communications systems. Working with GDUK,
iAnywhere plans to implement its
industry-leading, small
footprint–embedded database into
a mobile military solution as part of
the Ministry’s BOWMAN CIP project, which will improve communications for the Army, Royal Navy,
and Royal Air Force. The iAnywhere
solution was chosen because its
database technology offered the
best results throughout rigorous
benchmarking analysis and was the
best engineered for the mobile battlefield environment.
Mobility Product of the Year
7/1 – iAnywhere Solutions, a subsidiary of Sybase, announced that
its XcelleNet Afaria solution was
named “Mobility Product of the
Year” in the International Data
Group (IDG) 2004 Network
Awards. The prestigious awards
recognize the best in the industry,
rewarding companies and individuals for innovative and effective
use of networking and telecommunications technology.
EVENTS
South American PB Seminars
Ruben Pillaca, the author of
Aplicaciones Distribuidas Con
PowerBuilder – a third-party
PowerBuilder book in Spanish – is
hosting a series of PowerBuilder
seminars in select South American
cities. More information is available
on the www.powerbuilder.org site.
Power Puzzle Answer Key
UK Ministry of Defense
7/08 – iAnywhere Solutions, a subsidiary of Sybase, announced that
its SQL Anywhere Studio database
technology was chosen by General
Dynamics UK Ltd. (GDUK) as a key
component of the UK’s Ministry of
www.SYS-CON.COM/pbdj/
Forget the wires.
We know
the ropes.
Wondering how to get your Wi-Fi projects off the ground? We can show
you how. We’re iAnywhere Solutions,
the leading provider of solutions for
the unwired enterprise.
Emerging wireless technologies such
as Wi-Fi now enable businesses to
deliver a desktop computing experience to mobile workers. We have
more than a decade of experience
delivering "always available" access to
corporate data and applications –
keeping your mobile workers productive when they don’t have a wireless
connection and providing information
security and synchronization services
when they enter a wireless LAN or hot
spot.
More than ten thousand companies
and one thousand partners worldwide
rely on mobile technology from
iAnywhere Solutions.
Let us show you the ropes to get your
Wi-Fi solutions off the ground quickly. Call 1-800-801-2069 or visit
www.ianywhere.com.
Copyright 2003. iAnywhere Solutions, Inc. All rights reserved. iAnywhere is a trademark of Sybase, Inc. or its subsidiaries.
All other trademarks are the property of their respective owners.
www.ianywhere.com