Rules of Rules of - SYS

Transcription

Rules of Rules of - SYS
ANNOUNCING POCKETBUILDER V2.0
pg. 28
U.S. $15.00 (CANADA $16.00)
NOVEMBER 2004 - Volume: 11 Issue: 11
www.sys-con.com/pbdj.com
From the Co-Editors
PocketBuilder Kudos
Things should really begin to get
interesting now that PocketBuilder 2.0
provides smartphone support
by Bruce Armstrong pg. 3
Ida, Sally, and Harry
A sampling of different user types
Bob Hendry pg. 4
Industry Announcements
by Bruce Armstrong pg. 34
iAnywhere Solutions is working with
Sony Ericsson to provide AvantGo
mobile content to users of the new
Symbian-based P910 smartphone
Rules of
DATA
NORMALIZATION
pg.22
pg.16
•••
PowerObjects released smlPortal 3.0,
which allows IT organizations to deploy
PowerBuilder DataWindow-based
reports and forms to the Web
•••
Sybase releases the first free deployment
version of an enterprise-class Linux
database: Sybase Adaptive Server
Enterprise Express Edition for Linux
RETAILERS PLEASE DISPLAY
UNTIL JANUARY 31, 2005
$15.00US $16.00CAN
11
03
0
09281 01314
3
Enterprise Distribution of
Your PocketBuilder Applications
Berndt Hamboeck
Distribute applications to end users in a professional way
Source Code Control: SCC Issues
and Enhancements with
PowerBuilder 10 Migrating to PB 10
Feature: Rules of Data
Normalization Data modeling
PowerBuilder in a .NET World
6
Paul Horan
12
Mike Nicewarner
16
Xue-song Wu
Preserve your investments, skills, and knowledge in PowerBuilder
22
First Look: Flying High with
PocketBuilder v2.0 A competitive edge
28
Ian Thain
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
NATALIE CHARTERS
MARTIN WEZDECKI
JOHN OLSON
BERNIE METZGER
BRUCE ARMSTRONG
RICHARD BROOKS
BAHADIR KARUV, PhD
WRITERS IN THIS ISSUE
BRUCE ARMSTRONG, BERNDT HAMBOECK, BOB HENDRY,
PAUL HORAN, MIKE NICEWARNER, IAN THAIN, XUE-SONG WU
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
CREDITS & ACCOUNTS RECEIVABLE STEVE MICHELIN
FINANCIAL ANALYST: JOAN LAROSE
ACCOUNTS PAYABLE: BETTY WHITE
ADVERTISING DIRECTOR: ROBYN FORMA
SALES & MARKETING MANAGER: MEGAN MUSSA
ASSOCIATE SALES MANAGER: KRISTIN KUHNLE
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
SUBSCRIBE@SYS-CON.COM
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 BJGAssociates@cs.com
FOR LIST RENTAL INFORMATION:
Kevin Collopy: 845 731-2684, kevin.collopy@edithroman.com
Frank Cipolla: 845 731-3832, frank.cipolla@epostdirect.com
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.
PocketBuilder Kudos
BRUCE ARMSTRONG
F
or all you PocketBuilder (aka Pocket PowerBuilder) fans out
there, you’ll be pleased to hear that PocketBuilder 1.5 was
recently awarded the Gold Star (the highest award) in the
Developer Tool category by Mobile Village. The iAnywhere subsidiary of Sybase also received Gold Star awards for SQL Anywhere
Studio (Database Category), mBusiness Studio (Middleware),
XcelleNet Afaria (Mobile Device Management), and Avantgo
(Wireless Web Content Provider). This continues the PocketBuilder recognition,
which began with PocketBuilder 1.0’s receipt of a Jolt Productivity Award from
Software Magazine.
Things should really begin to get interesting now that PocketBuilder 2.0 provides
smartphone support. The latest version was announced at the PocketPC Summit
2004 and CTIA Wireless I.T. & Entertainment 2004 conference in late October and
should start shipping at the end of November.
Why is this important? As WirelessNewsFactor recently noted (citing a recent IDC
report), the PDA market has gone relatively flat largely because end users are switching to smartphones instead. This was also noted by Zelos Group, which is predicting
the demise of the PDA platform. HardWareZone also had a similar
take on the recent decline in PDA sales as did eWeek, The
Inquirer, and ComputerWeek. Of course, many of those new
smartphones are Symbian based, but Microsoft and Motorola
have indicated that they are working together to make Windows
Mobile more dominant.
I’m a convert. I’ve been
using a Motorola MPx200
since February and am planning on upgrading to the
MPx220 when it becomes
available (latest rumor is
that my provider will
announce this release later
in November). Of course, if
you must have a stylus, you might
want to look at something like the MPX instead, which also has a
small keyboard. If you need a mouse too, a Bluetooth-enabled
mouse for smartphones was just introduced (see the
WindowsForDevices.com Web site for info).
The smartphone boom may also be indicated by
the renewed interest in that platform as a target for
Internet-based apps. Yahoo has just introduced mobile
versions of Yahoo Search and Yahoo Local, responding
to Google’s support for the mobile platform, particularly
their recent introduction of Google SMS. Finally, as evidence
of the growing support for the Windows Mobile platform for
the Smartphone, there are reports that palmOne may introduce a Pocket PC–flavored Treo, which didn’t do much to
help out the share price of its corporate sibling
PalmSource.
All in all, good news for a great product. ▼
brucea@sys-con.com
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 11
3
FROM THE CO-EDITOR
Ida, Sally,
and Harry
WRITTEN BY
BOB HENDRY
e’ve all run across different types of users who
can make our work a little more difficult. Once
you understand them, maybe, just
maybe, they’ll be easier to deal with.
W
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
IDA
Ida is the user who, completely devoid
of any malevolent intent, can utterly devastate her computer and/or the network
faster than a speeding bullet. She means
well, and tries hard to follow your instructions, but it’s as though her body chemistry
emanates some unseen force that is lethal
to computer hardware and software. She
can do every step by the book, and still the
system crashes.
At first you may think poor Ida just happened to inherit bad hardware. But moving
her to a different machine or giving her a
brand new one doesn’t cure the problem;
each system she touches suddenly begins
to exhibit strange behavior and unusual
errors, even though she swears on a stack
of Bibles (and you believe her) that she did
nothing to provoke such a reaction. You can
even stand there and watch her, verifying
that she did nothing out of the ordinary,
and the system merrily crashes or the network disappears for no apparent reason.
Most programmers have encountered
at least one or two Idas in their careers. In
many ways, she is the most frustrating of
the problem user types, because you can’t
really get mad at her. She’s a victim of the
technology that, to all appearances, just
doesn’t like her. She apologizes profusely
each time she has to call you. Although you
may be skeptical at first, you’re likely to
eventually give up trying to explain the
phenomenon and agree with her own
assessment of the situation: when it comes
to computers, she’s cursed.
Dealing with Ida requires a lot of
patience and a cultivated bedside manner.
Showing your frustration will only make
her feel worse, which may result in her
being hesitant to let you know the next
time there’s a problem (and thus, making
the problem that much worse by the time
you do discover it). Ida requires a little
PBDJ volume11 issue 11
handholding, a lot of reassurance, and, if
you can swing it, maybe an exorcist to
purge the demons that inhabit every system with which she comes in contact. It’s
much easier to feel sorry for Ida than for
her fellow “problem child,” Sally
Secretkeeper.
SALLY SECRETKEEPER
Ida may keep her computer problems
secret if you yell at her or make her feel
more stupid than she already feels, but otherwise she will usually try her best to
answer your questions and tell you what
you need to know. Sally Secretkeeper, on the
other hand, is a different type. She deliberately withholds information. Trying to find
out what she was doing when the connection was lost or what error message
appeared on her screen as the system went
down is like pulling teeth.
Sally’s reasons for remaining incommunicado can be a mystery. Maybe she figures
you get paid the big bucks to diagnose and
fix the IT problems so she’s going to make
sure you earn every penny of it with no
help from her. Maybe she’s afraid she won’t
remember correctly and will give you bad
information. Or maybe she’s just watched
too many cop shows on TV and has decided that she has the right to remain silent.
Whatever her motive, Sally can make your
job more difficult unless you learn how to
handle her “silent treatment.”
If the user who’s having computer or
network problems is a secretkeeper, you’ll
need to approach her carefully. Normal
questioning techniques won’t elicit much
information, and if you start demanding
answers, she’s likely to shut up even tighter.
The key to drawing the information out of
Sally’s type is to take a roundabout path.
See if you can get her engaged in conversation about something that interests her
(Hint: take a look at her desk and office
walls. What do you see? Pictures of
kids/dogs/spouse? Movie posters?
Company golf team trophies?). Slowly bring
the topic around to her computer problems. You’ll have to gain her confidence
before she’ll spill the beans.
You say you don’t have time to play
these games? The sad fact is: if you don’t use
these “stealth maneuvers” with Sally, you
may spend (waste) far more time trying to
determine what the problem is without her
input. Network admin/tech support is a
people-oriented position. People means
politics. And politics means you’ll have to
learn to be a politician now and then,
whether you like it or not.
Sally’s antics can be maddening, but at
least they aren’t deliberately destructive.
The same cannot always be said for the
next trouble type, Harry Hacker.
HARRY HACKER
Harry is probably the most notorious of
our problem user types. This category can
actually be broken down into several “subHarries.” If he’s the genuine article, Harry
Hacker probably knows a lot more about
computers and networking than you do.
Looking at it from his point of view, it’s either
a little annoying or a little amusing to him
that you’re making rules and telling him
what he can and can’t do with his computer.
From your point of view, Harry has the
power to really wreak havoc on your network.
Coming on strong and making an enemy of
Harry may not be the smartest thing to do.
You don’t have to like him, but you’d best
respect his abilities. Depending on his personality, the best tactic may be assimilation –
that is, take him into the fold. Let him know
you admire his skills. Ask his advice on how to
secure the network against those other, irresponsible users. Of course, if Harry is a
destructive type and can’t be turned into an
ally, your only option may be reporting his
transgressions to his superiors. Before you
choose that road, make sure you have everything important backed up, and expect retaliation. Hell hath no fury like a hacker scorned.
Adding It All Up
Ida, Sally, and Harry are only a sampling
of the difficult user types that you may
encounter as an IT professional. Each type
has its own characteristics, and you may
have to adopt different techniques for dealing with each. ▼
bob@sys-con.com
www.SYS-CON.COM/pbdj/
POCKETBUILDER
Enterprise Distribution of Your
PocketBuilder Applications
WRITTEN BY
BERNDT
HAMBOECK
Distribute applications to end users in a professional way
s professional PocketBuilder
developers we’d like to distribute our cool and innovative applications to all other
Pocket PCs around the world. Good
idea, but how do we do that?
A
Is a standard Pocket PC user able to
copy files to his device using
ActiveSync? I don’t think so and it’s not
very professional to ask your users to
copy your executable files to a specific
directory on the device, the
PocketBuilder runtime to another one,
the database file into a third one, the
DSN file to the root of the device, and so
on. It would be a fairly hard job for the
users and a lot of them wouldn’t be able
to do it the right way. To prevent users
from struggling with the different files
and their locations, we’ll use a new tool
that comes with PocketBuilder 2.0, the
CAB Configuration Tool application.
Let’s look at what you need to have a
professional-looking setup file for your
applications, and then we’ll see how we
can configure it to get perfect results.
This means one single setup file, which
makes it easy to distribute the application built in PocketBuilder to a Pocket
PC device.
How Does Deployment Work?
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
The Pocket PC operating system uses
a CAB file to install an application on a
Windows CE–based device. A CAB file is
composed of multiple files, in fact all
the files that you’d like to install to the
device, compressed into one single file.
• All the application’s files are present
in one place.
• You can prevent a partial or corrupt
installation.
• All files are from a defined version
and there is no version mismatch.
• The compressed file is small and easy
to transmit per e-mail or even on a
good old 3” disk.
• Use a well-described application
PBDJ volume11 issue 11
(Cabwiz.exe) to generate a file for
your applications.
Now you’re committed to CAB files,
but how are they created? There are two
options. You can check the “Create CAB
file” checkbox in the project painter of
PocketBuilder, which includes only your
application, not the database files, the
runtime files, or any other file needed by
your application. This might not be
what you want, so the other option is to
create a CAB file on your own; however,
this is not as easy as it might sound. In
fact it’s a bit complex to create a devicespecific CAB file for one of your applications. You have to create an INF file with
Windows CE–specific modifications and
use the CABWIZ.EXE tool to create the
CAB file. Let’s look at what this INF file
should look like:
1. Version (required): Specifies the creator of the file and other relevant
information.
2. CEStrings (required): Specifies string
substitutions for the application
name and the default installation
directory.
3. DefaultInstall (required): Describes
the default installation of your application.
4. SourceDiskNames (required):
Describes the name and path of the
disk on which your application
resides.
5. SourceDiskFiles (required): Describes
the name and path of the files in
which your application files reside.
6. DestinationDirs (required): Describes
the names and paths of the destination directories for your application
on the target device.
7. CopyFiles (required): Under the
[DefaultInstall] section, [CopyFiles]
describes the default files to copy to
the target device.
8. AddReg: Under the [DefaultInstall]
section, the [AddReg] section is
required and describes the keys and
values that the .cab file adds to the
device registry.
9. CEShortcuts: A Windows CE–specific
section under the [DefaultInstall] section, this [CEShortcuts] section is
optional and describes the shortcuts
that the installation application creates on the device.
PocketBuilder ships with a full
example for an INF file that you’ll find
under %pocketbuilder 2.0%\Code
Examples\salesdb\CE\cust_SalesDB.inf
(where %pocketbuilder 2.0% points to
your PocketBuilder installation directory). After creating the INF file, use the
CABWIZ tool to create the actual CAB
file by using the following command:
%pocketbuilder 2.0%\Support\cabwiz\CABWIZ.EXE yourinffile.inf/cpu
ARM.
An easier way is to use the new CAB
configuration tool. Open it by clicking
on File->New->Tool within
PocketBuilder 2.0 (see Figure 1) and
configure all the options you would type
into the INF file directly by using a
graphical user interface.
After opening the tool you’ll see four
different tab folders:
• CAB Config: This folder is for configuring the application that we would
like to build a CAB file for, and is
where the PocketBuilder application
comes from and where it will go to.
• DB Config: Here we configure if we
would like to distribute a database
application and if so, which version of
FIGURE 1 | New CAB configuration tool
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
here into a document, for example.
• Build: In this folder we can create our
CAB file that we would distribute to
our potential customers.
Let’s have a closer look at these folders and see what and how we will configure all the necessary sections for the INF
file.
•
•
The CAB Config Folder
FIGURE 2 | CAB Config tab
FIGURE 3 | Database Options tab
FIGURE 4 | Preview tab
Sybase SQL Anywhere for CE we
would like to use (the free one included with PocketBuilder, or the licensed
one), the database, and the DSN file.
• Preview: This folder displays the created INF file; we could copy it from
8
PBDJ volume11 issue 11
This folder defines what you would
like to deploy to your device and where
the files come from. A PocketBuilder
device not only distributes itself, it
might need the PocketBuilder runtime,
so you’d like to create a shortcut on the
device. This will be configured here.
For an example configuration see
Figure 2.
• The first part defines where your
application will be deployed to on
the device. By default both the company and application names are
used for the destination directories.
If the checkbox “Use comp. and appl.
name as depl. path” is checked, the
application will be deployed to the
directory %C1%\<company>\<appname>, where %C1% is a directory
placeholder and stands for the language-independent Program Files
folder on your device. Table 1 provides a complete list of all directory
placeholders. The application name
is also used as a shortcut on the
device.
• Depending on which platform you’d
like to distribute your application, different PocketBuilder and Sybase SQL
Anywhere runtime files are needed.
You can choose between the following
platforms:
–Arm (your real Pocket PC device)
–Emulator (the Pocket PC emulator)
–Smartphone (a real Smartphone)
–Smartphone Emulator (the
Smartphone emulator)
• The PocketBuilder and Sybase SQL
Anywhere runtime files are located on
the desktop. This is automatically set
by the CAB creation tool, but feel free
to choose a different location. If the
tool finds a licensed Sybase SQL
Anywhere CE installation, it will take
this one, otherwise it will use the free
version that’s included with
PocketBuilder.
• Defines the location of the
PocketBuilder and Sybase SQL
Anywhere runtime files on your
device.
• The application directory on the desktop where all your application files are
stored should be distributed to the
•
•
•
chosen device or emulator (for example, .inf, .gif, .jpg, .pbd, and .exe files).
Includes the name of the executable
(has to reside in the application directory). This will also be used to create
the shortcut.
Defines which files you would like to
include from the application directory
on the desktop as a comma-separated
list. If you would like to include all
files, simply enter “*.*”; to include
only some file types add *.<ext>; to
include all EXE and PBDs enter “*.exe,
*.pbd”. To include specific files simply
use the full name.
If you would like to create a shortcut
on the device, check the “add Shortcut
to Start Menu” checkbox.
The shortcut is placed by default into
the following path: \Windows\
Programs\ApplicationName. This can
be reconfigured by changing the shortcut path (note that you can not change
the %C11% directory placeholder).
If you don’t want to deploy the
PocketBuilder Applist application,
uncheck the box.
The DB Config Folder
If you wrote a PocketBuilder application that uses a SQL Anywhere database,
you’ll have to configure this folder. It
simply defines the locations for your
database files; for an example configuration see Figure 3. Configure the following
options:
• Do you want to use Sybase SQL
Anywhere? If this checkbox is not
checked, all options will be ignored.
• The name and location of your DSN file
on the desktop that will be deployed to
the root folder on your device.
• The location of your database file (and
the optional corresponding log file) on
the desktop.
• Where will the database be placed on
the device?
• Which language and version do you
want to use for Sybase SQL Anywhere
and is the SQL Anywhere installation
licensed? The version and licensed
options are not used in the current version of the “CAB Generation” tool. The
licensed box is for information purposes only at the moment, but in the
future you’ll define which runtime files
you’d like to distribute (for example,
use Mobilink or not). Currently all runtime files are deployed to the device.
The Preview Folder
This page has the complete INF file
that will be used when you create the
CAB file (see Figure 4). Feel free to check
it out. This is the same file you would
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
\Windows\Start Menu folder so I see the
CAB file in the start menu). Simply tab
on it on your device and you’ll see that
all your files are installed properly in the
right directories (note that the CAB file is
then deleted automatically).
Setup Creation
FIGURE 5 | Build tab
need to create if you wanted to build a
CAB file by hand. Note that if you do any
changes here, this will not influence the
creation of the CAB file. This tab folder is
only for informational purposes. If you
would like to make changes, copy the text
onto the clipboard and use your favorite
editor to work on it and call cabwit by
hand.
The Build Folder
In this folder it’s possible to create a
CAB file for distribution and, as a second step, a professional-looking setup
file that you’d like to distribute to your
end users. For an example configuration, see Figure 5.
CAB Creation
To create a CAB file, use the tool
CabWiz.exe (for PocketPCs) or
CabWizSP (for Smartphones). These files
come with your PocketBuilder installation and reside in the directory
%PocketBuilder 2.0%\Support\cabwiz.
We won’t have to define a lot here,
because most of what is already needed
has been configured on the first two
folders. We have to configure:
• The output path for the generated INF,
CMD, and CAB file.
• The name of the INF file you would
like to use that is passed to the cabwiz
application.
• The name of the CMD file; this file
simply calls the cabwiz with the needed parameters.
Take care that the radio button is
checked and click the Build button.
You’ll see a command shell popping up
to create your CAB file. Feel free to
upload this CAB file to your device by
using ActiveSync (I use the
10
PBDJ volume11 issue 11
To create a setup file for the end
users, the CAB generation tool uses
EZSetup. This is a free application
(download it from www.spbsoftwarehouse.com) for creating installation
programs for Pocket PC devices. The
installers created by EzSetup are very
intuitive for end users. This means that
these users don’t have to worry about
choosing between several installation
files. There is simply one executable
that has to be used, and it installs the
application on the device. The EzSetup
installer programs are always provided
with a customizable readme and a
license agreement. The installers are
compressed, self-contained, and selfextracting, and can be created in several
languages. EzSetup is a command-line
application with some parameter keys. If
you want to create an installer for some
program you’ve written for a Pocket PC
device, just run EzSetup with the desired
parameters and provide it with the CAB,
readme, and license agreement files. This
is exactly what the CAB generation tool is
doing. It generates a command file with
all the needed parameters. Such a command file would look like this:
Set EZ="c:\Sybase\Pocket PowerBuilder
1.5\Support\ezsetup\ezsetup.exe"
String
Directory
%CE1%
%CE2%
%CE3%
%CE4%
%CE5%
%CE6%
%CE7%
%CE8%
%CE9%
%CE10%
%CE11%
%CE12%
%CE13%
\Program Files
\Windows
\Windows\Desktop
\Windows\Startup
\My Documents
\Program Files\Accessories
\Program Files\Communication
\Program Files\Games
\Program Files\Pocket Outlook
\Program Files\Office
\Windows\Programs
\Windows\Programs\Accessories
\Windows\Programs\
Communications
\Windows\Programs\Games
\Windows\Fonts
\Windows\Recent
\Windows\Favorites
%CE14%
%CE15%
%CE16%
%CE17%
Table 1 | Directory placeholders
%EZ% -l english -i c:\PKExeGen\sample\EXE.inf -r
c:\PKExeGen\sample\exe\readme.txt -e
c:\PKExeGen\sample\exe\eula.txt -o
PKSample.exe
Now, let’s look at the fields we would
have to fill in to get this exact output:
• Configure the EZSETUP path. This is
needed only once as this path will be
remembered for future use.
• The name of the INF file that’s used by
EzSetup to register a CAB file with
CEAppMgr.exe (better known as
ActiveSync). It executes CEAppMgr in
the background with this INI file – a
CEAppMgr-specific INI file – that will
determine which CAB file to install for
the connected device. By the way, the
full path and filename of CEAppMgr
(ActiveSync) is stored in the desktop
registry under the key: HKLM\Software\Microsoft\Windows\CurrentVers
ion\App Paths\CEAPPMGR.EXE. If you
want to have an inside look at how
EzSetup is developed, feel free to grab
the source code from the same site.
• The name of the command file where
the call for EzSetup and its parameters
are listed.
• The INF and CMD file will be placed in
the directory you defined as “Output
Path”.
• The full path and name of your EndUser License Agreement (EULA). This
is a legal contract between you and the
end user of your application. The
EULA details how the software can
and cannot be used and any restrictions that you impose (e.g., most
EULAs prohibit the user from sharing
the software with anyone else).
• The full path and name of your
readme, which should be a small text
file that contains information not
included in the official documentation. Typically, readme files contain
late-breaking information that for
some reason could not be included in
the printed documentation.
• The language text your end users see
when they walk through the created
end-user setup file. Supported languages are “English,” “German,”
“French,” “Italian,” “Swedish,”
“Portuguese,” and “Spanish.”
The CAB generation tool uses the
following options in the background
and can’t be configured directly by the
user:
• The name of the CAB file used is
determined automatically by the CAB
~continued on page 30~
www.SYS-CON.COM/pbdj/
SOURCE CODE CONTROL
SCC Issues and Enhancements
with PowerBuilder 10.0
Migrating to PB 10
WRITTEN BY
PAUL HORAN
s we all know by now, the
interface between PowerBuilder
and the myriad of Source Code
Control (SCC) providers was
completely rewritten with the release of
PB 8.0. Over the past three years,
PowerBuilder’s SCC interface has been
in a nearly constant state of evolution,
and several key enhancements were
released with PB9.0 and 9.0.1.
A
These included:
• The OrcaScript batch command language processor was released; it
allows the development of unattended refresh and build scripts.
• The Refresh Status thread in the IDE
was moved to an asynchronous thread,
allowing it to run in the background.
• The SccQueryInfoEx() extension to the
SCC API allowed the implementation
of “Diff by Version Number,” which
significantly improved the performance of the Refresh Status process.
PowerBuilder 10.0 was released in
August of 2004, in conjunction with the
20th anniversary of Sybase, and the SCC
interface is once again a subject of discussion. This article focuses on several
key issues that development shops will
need to be aware of as they migrate to
PowerBuilder 10, with regard to their
use of Source Code Control tools.
Unicode!
AUTHOR BIO
Paul Horan is the senior
architect at Video
Communications, Inc.,
of Springfield, Mass,
and has been working
with PowerBuilder since
version 1.0b. Paul was
inducted into the ranks
of TeamSybase in May
of 2000, and is currently living in Buffalo, NY.
12
PowerBuilder 10 is the first release to
fully support the Unicode encoding
scheme. Unicode is the universal character encoding scheme for written characters and text. Unicode replaces a proliferation of character sets and encoding
schemes with a single, globally interoperable standard. PowerBuilder 10 not
only supports Unicode, it actually uses
Unicode character encoding internally.
What does this mean to you, as a
PowerBuilder developer? It means that
even if your application will never need
PBDJ volume11 issue 11
to store or display an Arabic or Kanji 16bit (double-byte) character, the code in
your PBLs will be stored internally in a
16-bit encoding scheme. In fact, you
may notice that after migrating to PB10,
your PBLs will be just about twice as
large as their PB9 counterparts.
Remember that nearly all SCC
providers operate by archiving the individual revisions to ASCII text files. When
a revised PowerBuilder object is checked
in, PB will first export the object’s source
into the Local Root Folder, and then send
that ASCII text file to the SCC provider.
The SCC tool increments the tip revision
number and tracks the change accordingly. ASCII is an 8-bit, or single-byte,
encoding scheme. However, the code in
the PBLs is now stored in UTF-16LE, a
16-bit Unicode scheme. The PB engineering team had to devise an encoding
format that could use 8-bit ASCII to represent 16-bit Unicode source. The answer
was HEXASCII, which is one of several
new source file export formats available
in the Export Entry dialog. Figure 1
shows the PB10 Export Entry dialog, with
the four new export formats available in
the Encoding: dropdown list.
UNICODE LE (LITTLE ENDIAN)
This format is the “default” format
when using the Export… menu option
to manually export an object to a
source file. This encoding scheme is
capable of handling source that contains both single-byte and double-byte
characters, and it also matches the
internal encoding scheme within the
PBL. The first line in the file will contain
a 2-byte prefix 0xFFFE that flags the
encoding scheme as UTF-16LE. You
won’t see this prefix unless you open
the source file in a Hex editor. Files
exported with this encoding scheme
cannot be imported back into PB9.
UTF-8
This format is the single-byte encod-
ing scheme, so files encoded with this format will be half the size of their Unicode
partners. The prefix in these files is 3bytes long: 0xEFBBBF. Files encoded in
this scheme cannot handle source code
containing double-byte characters, nor
can they be imported back into earlier
versions of PowerBuilder.
ANSI/DBCS
Files exported with this choice will be
single-byte or double-byte, depending on
the source. In PB9 and earlier, source was
either all single-byte or double-byte.
These files contain no prefix code, therefore ANSI/DBCS is the only encoding
scheme that PB9 can successfully import.
HEXASCII
Files encoded with the HEXASCII
scheme contain the two-byte prefix HA,
and use a single-byte ANSI encoding
scheme. However, this encoding scheme
is still capable of representing double-byte
characters through the use of bracketed
“escape sequences.” For example, a typical
HEXASCII export file might contain the
following single-byte string sequence:
$$HEX2$$c189d063$$ENDHEX$$Single byte
text$$HEX2$$417ed49a$$ENDHEX$$
Any characters found between the
$$HEX2$$ and $$ENDHEX$$ strings
represent the double-byte characters in
the original source code. This format
was developed so that PowerBuilder
could use Unicode internally, but the
SCC providers could still operate on
single-byte ANSI-encoded text files.
This format is used for all SCC operations with PB10, and is not backward
compatible with PB9.
Migrating to PowerBuilder 10
I’m sure you’ve found all that fascinating, but what does it have to do with
migrating to PowerBuilder 10? I’m glad
you asked…
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.
objects in place. Now, go to the workspace properties dialog and reconnect
it to the SCC project. The object statuses will all show as “checked out,”
and you can perform a target-wide
check in for all the objects. This will
maintain all the existing history in the
SCC repository prior to the migration.
OrcaScript Enhancements
FIGURE 1 | PB10 Export Entry dialog
A typical migration effort from one
version of PowerBuilder to another is a
simple matter of opening the application or
target in the new version of PowerBuilder
and allowing the IDE to “do its thing.” A cup
of coffee later, and your PBLs have all
been migrated into the new version.
However, this is the first release of
PowerBuilder that actually changes the
code during the migration process. The
PB10 migration process reencodes the
entire source into Unicode. From that
point forward, all SCC operations are
conducted with the HEXASCII encoding
scheme, therefore all the export files have
the HA header prefix. It doesn’t sound like
a significant change – just two letters in
the first line of code, but these two letters
are not in the tip revision inside the SCC
repository. Migrating to PowerBuilder 10
therefore violates the first commandment
of source code management: thou shalt
not edit an object unless thou hast first
checked out that object.
If you migrate your source-controlled
application code to PowerBuilder 10,
you’ve done exactly that – written a change
into your local copy of the PBL without
first checking out the objects. The first time
you connect to the SCC provider from
PB10, all the objects will show as “out of
sync,” and a subsequent GetLatestVersion
will actually “unmigrate” them.
There are two possible solutions to
this dilemma:
1. Start fresh. Migrate into a new PB10
workspace and register all the objects
into a new SCC project as revision
1.0. The only downside (for everyone
except PBNative users) is that the history of changes to the objects
remains in the previous SCC project.
2. Perform a target-wide checkout prior
to migration. Open the workspace in
your current version of PowerBuilder
and perform a target-wide checkout.
Do this for all the targets in the workspace. When you open the workspace
in PB10, the migration process will
proceed to completion, rewriting the
14
PBDJ volume11 issue 11
PowerBuilder 10.0 includes several
enhancements to the OrcaScript command-line utility and a sizeable number of bug fixes. The following list contains several of the bigger-ticket items.
• SCC SET CONNECT PROPERTY
PASSWORD “password”
This new command was added
specifically for users of Borland
StarTeam. StarTeam is one of the few
SCC providers that requires user authentication for all connection attempts.
OrcaScript could provide the user name,
but not the password, so the SCC CONNECT command would cause StarTeam
to present their connection dialog and
wait for user input. This totally defeats
the purpose of writing unattended batch
scripts, so this command was added to
supply the password during the
StarTeam connection attempt.
SCC CONNECT OFFLINE
At first glance, the terms “Connect”
and “Offline” might sound mutually
exclusive, but this new command
addresses a very typical situation. The
SCC REFRESH TARGET command is
not allowed without first issuing the
SCC CONNECT command. However,
mobile or occasionally connected
developers may not be able to establish a direct connection to the SCC
provider. SCC Connect Offline can be
used with the IMPORTONLY option to
rebuild a target from exported source
code files on a laptop or other remote
workstation. The typical scenario
would be:
• Developer synchronizes the files in
his or her Local Root Folder from the
SCC repository while connected.
• Disconnects the laptop from the network and boards a plane.
• Refreshes and rebuilds the target
from the exported source while disconnected.
SCC connect offline
SCC set target "myTarget.pbt"
"refresh_all importonly"
SCC refresh target "full"
SCC close
end session
• IMPORTONLY OUTOFDATE
The IMPORTONLY option to the
SCC SET TARGET command tells
OrcaScript that the files in the local root
folder contain the desired source, and a
“GET” from the SCC repository is not
necessary. In previous versions of
OrcaScript, this would import and
refresh all the files in the target,
whether or not they were actually out of
sync. PB10 now allows the combination
of the IMPORTONLY and OUTOFDATE
options on the SCC SET TARGET command. This will compare the source in
the PBL with the content of the exported source file, and only import those
objects found to be out of sync.
To use this feature, you must first
synchronize the files in the local root
folder from the SCC repository, which is
typically done with the SCC provider’s
command-line utility. This is a much
more efficient way of performing a target-wide GetLatestVersion than requesting the operation from within the IDE.
For example:
•
For example:
start session
SCC get connect properties
"myWorkspace.pbw"
start session
SCC get connect properties
"myWorkspace.pbw"
SCC connect offline
SCC set target ".\myTarget.pbt"
"importonly outofdate"
SCC refresh target "full"
SCC close
end session
• IMPORTONLY EXCLUDE_CHECKOUT
The EXCLUDE_CHECKOUT option
can also be added to the SCC SET TARGET command, and that will skip the
import process for any objects currently
checked out to the specified user.
This feature can also be used in conjunction with CONNECT OFFLINE for
disconnected rebuilds. However, that
forces OrcaScript to look into the .PBC
file to retrieve the checkout status of the
objects, so the objects must be checked
out prior to disconnecting from the SCC
repository. In addition, SCC GET CONNECT PROPERTIES “workspace” is
required to obtain the .PBC file when
using CONNECT OFFLINE. ▼
paulh@vcisolutions.com
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.
FEATURE
Rules of
Data
Normalization
Data modeling
WRITTEN BY MIKE NICEWARNER
I
n this article, I discuss and provide examples of the many rules of
data normalization. Currently I count at least seven, which are:
1. Eliminate repeating groups: Make a separate table for each set of
related attributes and give each table a primary key.
2. Eliminate redundant data: If an attribute depends on only part of
a multivalued key, remove it to a separate table.
3. Eliminate columns not dependent on the key: If attributes do not
contribute to a description of the key, remove them to a separate
table.
4. Isolate independent multiple relationships: No table may contain
16
PBDJ volume11 issue 11
two or more 1:n or n:m relationships that are not directly related.
5. Isolate semantically related multiple relationships: There may be
practical constraints on information that justify separating logically related many-to-many relationships.
6. Optimal normal form: A model limited to only simple (elemental)
facts, as expressed in ORM.
7. Domain-key normal form: A model free from all modification
anomalies.
Note: All normal forms are additive, in that if a model is in a third
normal form, it is by definition also in the second and first.
www.SYS-CON.COM/pbdj/
Eliminate Repeating Groups
In the original member list, each member name is followed by
any databases that the member has experience with. Some might
know many, and others might not know any. To answer the question,
“Who knows DB2?” we need to perform an awkward scan of the list
looking for references to DB2. This is inefficient and an extremely
untidy way to store information.
Moving the known databases into a separate table helps a lot.
Separating the repeating groups of databases from the member
information results in the first normal form. The MemberID in the
database table matches the primary key in the member table, providing a foreign key for relating the two tables with a join operation.
Now we can answer the question by looking in the database table for
“DB2” and getting the list of members (see Figure 1).
FIGURE 1 | List of members
Eliminate Redundant Data
In the database table, the primary key is made up of the
MemberID and the DatabaseID. This makes sense for other attributes like “Where Learned” and “Skill Level” attributes, since they will
be different for every member/database combination. But the database name depends only on the DatabaseID. The same database
name will appear redundantly every time its associated ID appears in
the database table.
Suppose you want to reclassify a database – give it a different
DatabaseID. The change has to be made for every member that lists
that database. If you miss some, you’ll have several members with
the same database under different IDs. This is an update anomaly.
Or suppose the last member listing a particular database leaves
the group. His records will be removed from the system, and the
database will not be stored anywhere. This is a delete anomaly. To
avoid these problems, we need a second normal form.
To achieve this, separate the attributes that depend on both parts
of the key from those depending only on the DatabaseID. This results
in two tables: “Database,” which gives the name for each DatabaseID,
and “MemberDatabase,” which lists the databases for each member.
Now we can reclassify a database in a single operation: look up
the DatabaseID in the “Database” table (see Figure 2) and change its
name. The result will instantly be available throughout the application.
Eliminate Columns Not Dependent on the Key
The member table satisfies the first normal form; it contains no
repeating groups. It satisfies the second normal form since it doesn’t
have a multivalued key. But the key is MemberID, and the company
name and location describe only a company, not a member. To
achieve a third normal form, they must be moved into a separate
table. Since they describe a company, CompanyCode becomes the
key of the new “Company” table (see Figure 3).
The motivation for this is the same for the second normal form:
we want to avoid update and delete anomalies. For example, suppose no members from IBM were currently stored in the database.
With the previous design, there would be no record of its existence,
even though 20 past members were from IBM.
Isolate Independent Multiple Relationships
This applies primarily to key-only associative tables and appears
as a ternary relationship, but has incorrectly merged two distinct,
independent relationships.
The way this situation starts is by a business request list similar to
Figure 4. This could be any two M:M relationships from a single entity. For instance, a member could know many software tools, and a
software tool may be used by many members. Also, a member could
have recommended many books, and a book could be recommended
by many members.
To resolve the two M:M relationships, we know that we should
resolve them separately, and that would give us the fourth normal
www.SYS-CON.COM/pbdj/
FIGURE 2 | Database table
FIGURE 3 | Company table
form. But, if we were to combine
them into a single table, it might look
right (it is in the third normal form)
at first. This is shown in Figure 5 and
violates the fourth normal form.
To get a picture of what is wrong,
look at some sample data, shown in
Figure 6. The first few records look
right, where Bill knows ERWin and
recommends the ERWin Bible for
everyone to read. But something is
FIGURE 4 | Initial business
wrong with Mary and Steve. Mary
request
didn’t recommend
a book, and Steve
doesn’t know any
software tools. Our
solution has forced
us to do strange
things like create
dummy records in
both Book and
Software to allow
FIGURE 5 | Incorrect solution
the record in the
association, since it is a
key-only table.
The correct solution, to
cause the model to be in
the fourth normal form, is
to ensure that all M:M relationships are resolved independently if they are indeed
independent, as shown in
FIGURE 6 | Sample data from an incorrect
Figure 7.
solution
PBDJ volume11 issue 11
17
FIGURE 7 | Correct fourth normal form
the information correctly. This time we would have even more trouble because we can’t show the relationships between books and software unless we have a member to link to, or we have to add our
favorite dummy member record to allow the record in the association table (see Figure 9).
The solution, as before, is to ensure that all M:M relationships
that are independent are resolved independently, resulting in the
model shown in Figure 10. Now information about members and
books, members and software, and books and software are all stored
independently, even though they are all very much semantically
related. It’s very tempting in many situations to combine the multiple M:M relationships because they are so similar. Within complex
business discussions, the lines can become blurred and the correct
solution not so obvious.
Optimal Normal Form
FIGURE 8 | Initial business request
At this point, we have done all we can with entity-relationship
diagrams (ERD). Most people will stop here because this is usually
pretty good. However, another modeling style called object role modeling (ORM) can display relationships that cannot be expressed in
ERD. Therefore there are more normal forms beyond the fifth form.
With the optimal normal form (OMF) it is defined as a model limited to only simple (elemental) facts, as expressed in ORM.
Domain-Key Normal Form
FIGURE 9 | Incorrect solution
FIGURE 10 | Correct fifth normal form
Note: This is not to say that all ternary associations are invalid.
The above situation made it obvious that Books and Software were
independently linked to Members. If, however, there were distinct
links between all three, such that we would be stating that “Bill recommends the ERWin Bible as a reference for ERWin,” then separating the relationship into two separate associations would be incorrect. In that case, we would lose the distinct information about the
three-way relationship.
This level of normalization is simply a model taken to the point
where there are no opportunities for modification anomalies.
If every constraint on the relation is a logical consequence of the
definition of keys and domains:
• A relation in DK/NF has no modification anomalies, and viceversa.
• DK/NF is the ultimate normal form; there is no higher normal
form related to modification anomalies.
• A relation is in DK/NF if every constraint on the relation is a logical consequence of the definition of keys and domains.
• Constraint is any rule governing static values of attributes that is
precise enough to be ascertained whether or not it is true, e.g., edit
rules, intrarelation and interrelation constraints, functional, and
multivalued dependencies, not including constraints on changes
in data values or time-dependent constraints.
• Key is the unique identifier of a tuple.
• Domain is a physical and a logical description of an attribute’s
allowed values.
• Physical description is the format of an attribute.
• Logical description is a further restriction of the values the domain
is allowed.
• Logical consequence is to find a constraint on keys and/or
domains that, if it is enforced, means the desired constraint is also
enforced.
The bottom line on DK/NF – if every table has a single theme, then
all functional dependencies will be logical consequences of keys. All
data value constraints can then be expressed as domain constraints.
Practical consequence – since keys are enforced by the DBMS and
domains are enforced by edit checks on data input, all modification
anomalies can be avoided by just these two simple measures. ▼
• • •
Isolate Semantically Related Multiple Relationships
Now let’s modify the original business diagram and add a link
between the books and the software tools, indicating which books
deal with which software tools, as shown in Figure 8.
This makes sense after the discussion on Rule 4, and again we
may be tempted to resolve the multiple M:M relationships into a single association, which would now violate the fifth normal form. The
ternary association looks identical to the one shown in the fourth
normal form example, and is also going to have trouble displaying
18
PBDJ volume11 issue 11
This article has been reprinted with permission from www.datamodel.org.
AUTHOR BIO
Mike Nicewarner has been doing data modeling since the early 1990s for a number of insurance,
manufacturing, and finance companies. He has taught and written a number of papers about data
modeling tools and techniques. When it comes to modeling tools, he strives to improve the state of
the art for everyone involved.
mike@datamodel.org
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 PBDJ
GETH
E R TM
.
volume11
issue 10
11
FEATURE
PowerBuilder in
a .NET World
Preserving your investment, skills,
and knowledge in PowerBuilder
WRITTEN BY XUE-SONG
ET is becoming (or rather it has already become) a mainstream application development platform for developing
both Windows Forms applications and Web applications,
and more and more companies have adopted the .NET
technology. Sybase anticipated this trend two years ago and developed a PowerBuilder .NET strategy. In that strategy, we decided to
support .NET in four major steps. In the first step, we released with
PowerBuilder 9 a PBNI extension called the WebServiceClient that
enables PowerBuilder to consume .NET Web services.
.N
In the second step, we released a new product – DataWindow.NET –
that makes the patented DataWindow technology available to .NET
developers. The PowerBuilder .NET compiler is the next step in the
strategy. In this article, I’ll give a brief introduction to the PowerBuilder
.NET compiler we are working on. (Please note that the PowerBuilder
.NET compiler is still in an early stage of development, so details are
subject to change.)
Overview
The goal of the PowerBuilder .NET transformer is to be able to compile PowerBuilder applications into .NET applications (which could be
a Windows Forms application, an ASP.NET application, or a smart
client application) and to compile PowerBuilder non-visual objects
(PowerBuilder NVOs) to .NET Web services. Compiling PowerBuilder
applications to Smart Client applications and compiling PowerBuilder
NVOs to .NET Web services might not be available in time for the next
major release of PowerBuilder.
Briefly the PowerBuilder .NET compiler consists of two main modules as shown in Figure 1: the PowerBuilder system library for .NET
and the MSIL emitter. The MSIL emitter compiles PowerBuilder code
into MSIL code that references the PowerBuilder system library for
.NET.
22
PBDJ volume11 issue11
WU
The MSIL emitter will be built into the PowerBuilder IDE in the next
major release, which will be virtually transparent to PowerBuilder
developers. What PowerBuilder developers will need to work with are
two wizards and two project painters. The wizards are the .NET application wizard and the .NET Web services wizard, and the project
painters are the .NET application project painter and the .NET Web
services project painter. The wizards guide PowerBuilder developers to
specific .NET projects, and the project painters are used to build .NET
projects. The painters might be able to create an .msi file (Microsoft
Installer file) that consists of the generated .NET application for
installing or deploying the generated .NET application or Web services
directly to the specified Web server. With these new wizards and
painters, the PowerBuilder developers will be able to easily create and
deploy .NET WinForm and WebForm applications, and Web services as
well.
PowerBuilder System Library for .NET
The PowerBuilder system library for .NET, also transparent to developers, implements all PowerBuilder system classes, enumerations, and
functions in .NET languages. The system library is basically managed,
but not 100% managed, because the system library for .NET still relies
on the DataWindow engine and the PBSHR.DLL library to communicate with database drivers.
Since the goal of the PowerBuilder .NET transformer is to be able to
compile PowerBuilder applications to both Windows Forms and Web
Forms applications, the system library needs to make PowerBuilder
controls (e.g., CommandButton) available for both Windows Forms
and Web Forms. To achieve this, we implement two sets of
PowerBuilder controls: one for Windows Forms and one for Web
Forms.
Figure 2 shows the assemblies of the system library and the related
components. The system library consists of five assemblies and relies
www.SYS-CON.COM/pbdj/
on DataWindow.NET, some third-party Web controls, and the
PBSHR.DLL.
• The Sybase.PowerBuilder.Core.Dll defines the fundamental components of PowerBuilder, including data types, arrays, enumerations,
and some base classes such as PowerObject and Transaction.
• The Sybase.PowerBuilder.Interop.Dll defines the PBSQL class for
handling embedded SQL statements.
• The Sybase.PowerBuilder.Common.Dll defines the PowerBuilder system classes that are common for both Windows Forms and Web
Forms (e.g., the Connection class).
• The Sybase.PowerBuilder.Win.Dll and Sybase.PowerBuilder.Web.Dll
each define all PowerBuilder controls, such as Window,
CommandButton, ListBox, and DataWindow.
PowerBuilder provides many features: data types, arrays,
function/event invocation, event handling, operators and expressions,
statements, DataWindow, embedded SQL, external functions, PBNI,
and EAServer integration, to name a few. You may be curious about
how all those features are mapped to .NET. Here are some details.
Mapping PowerBuilder Features to .NET
DATA TYPES
PowerBuilder provides 15 standard data types: blob, boolean, char,
date, datetime, decimal, double, integer, long, real, string, time,
unsignedinteger, unsignedlong, and longlong, and a special data type
(any) that can be used to represent any kind of data. One unique feature of PowerBuilder is that it allows you to get/set the nullness of a
value or a variable by calling the IsNull/SetNull system function.
To support the data types and nullness, we defined a .NET interface
IPBValue that has a property Null, which is both gettable and settable.
For each PowerBuilder data type, we defined a .NET structure that
implements the IPBValue interface. That way, it becomes possible to
get/set the nullness of a value or a variable.
Table 1 shows the mapping between PowerBuilder data types and
.NET data types. You may be worried about whether defining a .NET
structure for each PowerBuilder data type will affect the performance
of the emitted .NET assemblies. In fact, the impact is not significant
because .NET structures are value types that can be allocated from a
stack, which is far more efficient than the heap.
EVENT HANDLING
PowerBuilder was one of the pioneers in development tools that
explicitly defined an event model. It should come as no surprise that
.NET also defines an event model.
PowerBuilder defines about 600 events, most of which are associated with an event ID. For instance, the clicked event of the
CommandButton control is associated with the event ID
pbm_bnclicked. An event ID basically defines a method prototype,
which is very similar to a .NET delegate. We map PowerBuilder event
IDs to .NET delegates, PowerBuilder events to .NET events, and
PowerBuilder event handlers to .NET methods. For example, the
clicked event of the CommandButton-derived class cb_1 shown below
is conceptually translated into the following C# code:
public cb_1() {
this.ClickedEvent += PBM_EventHandler(this.clicked);
}
public PBLong clicked() /*pbm_bnclicked*/ {
PBSystemFunctions.MessageBox(new PBString("PowerBuilder"),
new PBString("Hello world"));
return new PBLong(1);
}
…
}
POWERBUILDER SYSTEM-DEFINED ENUMERATIONS
PowerBuilder defines about 100 system-defined enumerations (e.g.,
Alignment, BorderStyle). For each of them, we defined a .NET enumeration that has exactly the same items as its PowerBuilder counterpart.
The name of the .NET enumeration is the name of the PowerBuilder
enumeration prefixed with “PB”. For instance, the PowerBuilder
BorderStyle enumeration is mapped to the .NET PBBorderStyle enumeration.
POWERBUILDER SYSTEM-DEFINED CLASSES
For each PowerBuilder nonvisual system class (e.g., Connection) we
defined a .NET class that is named the same as the PowerBuilder class
name prefixed with “PB”. The .NET class provides exactly the same
fields, methods, and events (if any) as its PowerBuilder counterpart.
PowerBuilder data type
Any
Blob
Boolean
Char
Date
Datetime
Decimal
Double
Int
Long
Real
String
Time
Uint
Ulong
LongLong
PBL
files
MSIL
Emitter
WinForm/
WebForm
Application
References to
PB
System
Library
For .NET
event clicked
messagebox(“PowerBuilder”, “Hello world”)
end
www.SYS-CON.COM/pbdj/
.NET data type
Object
byte[]
bool
char
DateTime
DateTime
decimal
double
Int16
Int32
float
String
DataTime
Uint16
Uint32
Int64
Table 1 | The mapping between PowerBuilder data types and .NET data
types
// PowerScript code
type cb_1 from commandbutton within w_main
…
end
// C# code
public class cb_1 : PBCommandButton {
public PBM_EventHandler ClickEvent;
.NET struct defined
PBAny
PBBlob
PBBoolean
PBChar
PBDate
PBDateTime
PBDecimal
PBDouble
PBInt
PBLong
PBReal
PBString
PBTime
PBUInt
PBULong
PBLongLong
FIGURE 1 | Main modules
PBDJ volume11 issue 11
23
Sybase.PowerBuilder.Win.DII
DataWindowControl
Sybase.PowerBuilder.Web.DII
Sybase.PowerBuilder.Common.DII
DataWindow
WebControl
Sybase.PowerBuilder.Interop.DII
Sybase.PowerBuilder.Core.DII
3rd party
WebControl
PDSIIR.DII
DB Driver
FIGURE 2 | System library and related components
PowerBuilder visual system classes are handled the same way as
nonvisual classes, except that we defined a .NET class in each of the
Sybase.PowerBuilder.Win and Sybase.PowerBuilder.Web namespaces.
For example, for the PowerBuilder CommandButton class we defined a
PBCommandButton class in each of the Sybase.PowerBuilder.Win and
Sybase.PowerBuilder.Web namespaces. The PBCommandButton class
in the Sybase.PowerBuilder.Win namespace is implemented using the
Button class in the System.Windows.Forms namespace provided by the
.NET Framework, while the class in the Sybase.PowerBuilder.Web
namespace is implemented using the Button class in the
System.Web.UI.WebControls namespace. The two sets of visual classes
make it possible to compile a PowerBuilder application into both a
Windows Forms and a Web Forms application.
OTHER FEATURES
Other features, including arrays, operators and expressions, statements, SQL statements, dynamic/post method invocation, PBNI, and
COM, are all mapped to a suitable .NET feature or implemented as
.NET classes.
With the PowerBuilder system library for .NET in hand, we can
compile a PowerBuilder application into a Windows Forms application,
a Web Forms application, or a smart client application, and a
PowerBuilder NVO (nonvisual object) into an ASP.NET Web service.
Windows Forms
The visual classes for Windows Forms in the PowerBuilder system
library for .NET are implemented using the Windows Forms controls
provided by the .NET Framework. As a result, the look and feel of a
Windows Forms application generated from PowerBuilder applications
(what we call PowerBuilder Windows Forms applications) would be the
same as typical .NET Windows Forms applications. PowerBuilder
Windows Forms applications will support all features of PowerBuilder,
and without the PBVM involved.
short form of “Just-In-Time Compile.” When the .NET runtime is about
to run an assembly, it will first compile the assembly into machine
code, which is called “Just-In-Time Compile.”) Therefore the performance of ASP.NET applications is appealing. ASP.NET is maturing
quickly. Microsoft has announced it will release ASP.NET 2.0 in year
2005. The Web Forms applications compiled from PowerBuilder applications (called PowerBuilder Web Form applications) are based on
ASP.NET, so they can take full advantage of ASP.NET.
MOVING POWERBUILDER APPLICATIONS TO THE WEB
The PowerBuilder .NET compiler will compile a typical
PowerBuilder client/server application into a three-tiered Web application, where the PowerBuilder client application becomes an ASP.NET
application that runs in a Web server.
When a user runs a PowerBuilder Web Form application from a Web
browser, the application renders itself into an HTML file and JavaScript
code, which is then displayed in the Web browser. When the user interacts with the application, certain post-back events will be triggered and
handled by the server-side controls, and a new HTML file and
JavaScript code will be generated to reflect the changes of the controls.
For n-tier PowerBuilder applications that involve an application
server, only the client application needs to be compiled into a
PowerBuilder Web Form application; the NVOs deployed to the application server will remain untouched.
Compiling a PowerBuilder application into a PowerBuilder Web
Form application doesn’t incur dramatic architectural changes. A
PowerBuilder application that doesn’t use an application server will
continue working without an application server; an application that
uses an application server will continue using it, and in the same way.
POWERBUILDER MAKES WEB DEVELOPMENT EASIER
There are some things that are difficult to do with ASP.NET, such as
showing a message box or a dialog (response window in PowerBuilder’s
terminology). Showing dialogs in ASP.NET applications is particularly
difficult, which was described as “Dialog Hell.”
In PowerBuilder applications when a function or an event opens a
message box or a dialog, the execution of the function or event will be
suspended until the message box or the dialog is closed; however, this
is hard to achieve in ASP.NET applications. First of all, there are no
built-in Web controls for a message box and dialog. Second, if an
ASP.NET thread is suspended somewhere, an HTML file will not be rendered and sent to the Web browser, and therefore the Web browser will
keep waiting for the response.
To overcome this, we’ve developed the WebMessageBox control for
showing message boxes, and the DialogOpener and DialogHolder controls for showing dialogs in a Web browser. When you develop ASP.NET
applications with PowerBuilder, you don’t have to worry about how to
overcome the shortcomings of ASP.NET. The PowerBuilder .NET compiler does it all for you.
Web Forms
A BRIEF INTRODUCTION TO ASP.NET
ASP.NET provides a form-based programming method and an
event-driven programming model, making Web application development much like Windows Forms application development. ASP.NET
applications are built using Web controls that run at the server side.
Web controls can generate certain HTML content and JavaScript code
to represent them in a Web browser. When the user interacts with the
Web page, certain post-back events will be triggered for the server-side
code to handle.
ASP.NET also supports state management and cache, making it a
preferable platform for developing Web applications.
Developers can write business logic directly in ASP.NET pages or in
separate source files (known as code-behind) in any .NET language.
The code is compiled into .NET assemblies, which, in turn, are jitted at
runtime. (“Jitted” is the past participle of the word “JIT”, which is the
24
PBDJ volume11 issue11
STATES IN POWERBUILDER WEB FORM APPLICATIONS
One thing worth mentioning is that a PowerBuilder Web Form
application is a little different from a typical ASP.NET application
where the server-side controls are destroyed and re-created with each
server round-trip. The control tree of a PowerBuilder Web Form application is always kept in memory along with other nonvisual objects.
There are both pros and cons to this approach. The good thing is that
the ASP.NET runtime doesn’t need to re-create the control tree again
and again and no ViewState is needed to pass across the wire, which
implies that the performance is better. The downside of this approach
is that the scalability will be affected due to the fact that the states are
kept in process. If a PowerBuilder Web Form application is configured
to run in a Web Form, Server Affinity is required to make sure the
requests coming from the same client session are routed to the same
Web server. (The Windows Server 2003 Enterprise Edition provides a
www.SYS-CON.COM/pbdj/
clients (see Figure 3), so they can provide a rich and responsive user
experience and at the same time they are easy to deploy and maintain.
There is not a precise definition of smart clients yet, but smart clients
have some common characteristics: they utilize both local and network
resources, update automatically, and support occasionally connected
users.
Here is a scenario showing how a smart client works: the main
assemblies are deployed to a Web server, and a small stub program is
installed in client machines. Upon running, the stub program makes
sure the local assemblies are up-to-date, and then launches the real
application. When you upgrade the application, all you need to do is
copy the assemblies to the Web server.
Source: http://msdn.microsoft.com/smartclient/understanding/definition/
FIGURE 3 | Smart clients capture the benefits of both rich clients and Web
clients
service called Network Load Balancing, which can be configured to
support “Server Affinity,” also called “IP Affinity.” For details, please
refer to the article “HOWTO: Handle Web Client Session State in an
Application Center 2000 Cluster” from MSDN Knowledge Base, Article
ID: Q286279.)
In a future version, we may introduce additional features to save the
states in a StateServer or a database to improve scalability.
UNSUPPORTED FEATURES
The PowerBuilder .NET compiler can map almost all features of
PowerBuilder to ASP.NET, but certain things will not work or will work
differently from PowerBuilder due to the limitations of ASP.NET, which
uses HTML and JavaScript to simulate desktop applications. The
unsupported features include:
• ActiveX: Visual ActiveX controls will not be visible in a Web browser
because they can’t render themselves into HTML. Nonvisual ActiveX
controls will still be callable. Please note that you should avoid using
STA (Single Thread Apartment) COM components if possible
because they require Thread Affinity (by setting the ASPCompat
property to true).
• File operations: Since PowerBuilder Web Form applications run at
the server side, they cannot access files that are at client-side
machines.
• Registry: Probably not supported
• Clipboard
• Drag and drop
• Hot keys, shortcut keys, and accelerate keys
• Some events (e.g., mouse move event)
Smart Clients
A BRIEF INTRODUCTION TO SMART CLIENTS
ASP.NET is a great framework for developing Web clients, whose
most attractive point is that they are easy to deploy and maintain.
Nothing needs to be installed in the client machines, and upgrading a
Web client application involves merely copying files to the virtual folder. Web clients, however, do have their drawbacks: Web clients cannot
leverage on the power of client-side machines, and the user experience
of Web clients cannot be very rich. If an application requires a lot of
user interactions, making it a Web client application is just unacceptable.
Rich clients (e.g., Windows Forms), on the other hand, can provide a
very rich and responsive user experience that utilizes local resources.
But rich clients are harder to deploy and maintain. Installing and
upgrading a rich client application can be a real pain, because you
have to do it for each and every machine that needs to run the application.
That is where smart clients come to the rescue. Smart client applications are designed to provide the benefit of both rich clients and Web
26
PBDJ volume11 issue11
POWERBUILDER SMART CLIENTS
PowerBuilder smart client applications are basically Windows
Forms applications. The difference is that instead of compiling the
PowerBuilder application to an .exe file, the PowerBuilder .NET transformer compiles the PowerBuilder application into a .NET library, and
generates a stub program that can download the .NET library and
other necessary files from the specified Web server and launch the
application.
Web Services
Web services are ideal for cross-platform communication in heterogeneous environments because of their use of open standards such as
XML and Simple Object Access Protocol (SOAP). The ease of deployment and maintenance makes Web services a very attractive approach.
PowerBuilder 10 allows you to deploy PB NVOs as Web services, but
only through deploying the NVOs to EAServer, which may not always
be acceptable. In PowerBuilder DaVinci (the code name of the next
major release), you’ll have another choice: deploying PowerBuilder
NVOs as ASP.NET Web services. The tool for doing this is again the
PowerBuilder .NET compiler. The compiler can compile a
PowerBuilder NVO into an XML Web service class and generate an
.asmx file for it. With this feature, PowerBuilder becomes a much more
open Web services producer.
Summary
The PowerBuilder .NET compiler will preserve your investment,
your skills, and your knowledge in PowerBuilder. Without going
through the steep learning curve of .NET, PowerBuilder developers will
automatically become .NET developers for not only Windows Forms
applications, but also Web Forms applications.
In the releases beyond PowerBuilder DaVinci, you’ll be able to
import .NET classes into your PowerBuilder applications, which will
greatly increase the power of PowerBuilder. While PowerBuilder makes
common things easy to do, the ability to make use of .NET classes
enables you to do virtually anything that can be done with the .NET
framework.
In the future, PowerBuilder might become even more in line with
.NET. For example, the PowerBuilder IDE might host the .NET designer
for creating a user interface and generating UI code (still in
PowerScript), and the .NET compiler might become the native compiler of PowerBuilder. ▼
References
• http://weblogs.asp.net/jezell/archive/2003/08/26/25450.aspx
• http://msdn.microsoft.com/smartclient/understanding/definition/
AUTHOR BIO
Xue-song Wu is a staff software engineer in the Sybase Asia Development Center, Singapore, and a team
leader of the PowerBuilder Virtual Machine and Compiler team.
xue-song.wu@sybase.com
www.SYS-CON.COM/pbdj/
FIRST LOOK
Flying High with
PocketBuilder v2.0
WRITTEN BY
IAN THAIN
A competitive edge
can’t think of a better place to
stress the virtues of mobile applications than from where I’m writing this article, on Virgin Atlantic,
flight VS19 from London to San
Francisco. Even at 35,000 ft above
Greenland and traveling at 500 miles
per hour, I’m using a PocketBuilderbuilt Windows mobile smart client
application to access and update data
for later synchronization to my corporate database – occasionally connected, always available taken to new
heights.
I
As a reminder for the frequent flyer
or novice, the benefits that smart client
mobile applications offer to businesses
today are improved productivity, better
responsiveness and service, and more
accurate and timely data so that your
mobile workforce has a competitive
edge and reduction in back-office data
entry.
Why am I traveling to San Francisco?
Well, October was the month for CTIA
and the Pocket PC Summit and this was
where Sybase announced the successor
to Pocket PowerBuilder v 1.x. The first
version of this tool won the JOLT
Excellence Award and the Mobile
Village Award, so what is Sybase doing
to enhance the product? Aside from the
name change – the product will now be
called PocketBuilder beginning with
v2.0 – we are raising the altitude for a
RAD Windows mobile development tool
and setting the course for new areas of
productivity. Let’s take some time and
look at these new features.
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
Phone Enablement
These are the two words that
embody this release and cover a multitude of features that the PocketBuilder
engineers have worked long and hard
on. In fact, we know they have done
well when it becomes difficult to discuss these features in more than just a
few words.
PBDJ volume11 issue 11
What does phone enablement really
mean? From within your PocketBuilder
application on either a Pocket PC
Phone Edition or Smartphone device
(see Figure 1) you’ll be able to originate
and receive voice calls, send SMS text
messages, and interrogate the dialing
directory and call log.
These are all powerful features that
will add extra dimensions and innovation to your mobile applications.
Some of you may have seen my
Insurance Assessor application that I
demonstrated during the keynote at
TechWave this year. It allows an insurance assessor to manage appointments, input details in written text
pictures or voice, and synchronize
them back to the corporate database.
PocketBuilder v2.0 has the added
enhancement to enable Assessor to
send SMS messages to the client
directly. For example, if the assessor is
going to be delayed, a call can be
made directly to the client without
leaving the application.
Remember, to win at mobile application development your applications
must succeed in the key areas of usability, innovation, business process integration, and return on investment. All
of these key areas are addressed with
PocketBuilder.
Design Time and Runtime
Within the IDE there are a few
changes as well; these include being
able to change the window size to any
of the WM2003-SE supported types
(QVGA – Portrait, Landscape; VGA –
Portrait, Landscape, etc.). There is also
the functionality to specify different
input method modes for different entry
fields. For example, one field could
show the Keyboard IME (input method
editor) and others could show the Jot
IME (see Figure 3).
We have also added some new system-level functions for getting and setting the orientation of your WM2003
Second Edition device from within your
PocketBuilder application, as well as
FIGURE 1 | Pocket PC Phone Edition or
Smartphone device
Smartphone Changes
These changes will probably be the
features that you notice the least,
although a lot of work has gone into
them. For the important user interface
of your applications, we follow
Microsoft Design Standards and therefore have implemented at runtime the
spinner control (which can be seen in
Figure 2, for the current outgoing line)
for the DropDown ListBox and ListBox.
For Smartphone deployment,
PocketBuilder is now able to automatically sign a CAB file from the project
painter. This is a necessity for
Smartphone deployment.
FIGURE 2 | Spinner control
www.SYS-CON.COM/pbdj/
$198.00
*
(
FREE CD! VALUE!)
PBDJ ADVERTISER INDEX
ADVERTISER
URL
PHONE
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
11
E.crane
www.ecrane.com
603-226-4041
36
iAnywhere
www.ianywhere.com
800-801-2069
35
IT Solutions Guide
www.sys-con.com/IT
201-802-3020
27
PowerBuilder Developer's Journal
www.sys-con.com/pbdj
201-802-3026
31
Sybase
http://eshop.sybase.com/eshop
877-230-6771
13
Sybase
www.sybase.com/pbextension
877-230-6771
15
Sybase
www.sybase.com/powerbuilder
877-230-6771
7, 21
Sybase
www.sybase-iad-services.com/30081a 877-230-6771
9
Web Services Edge Expo
www.sys-con.com/edge
— 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!
PAGE
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/
201-802-3066
20-21
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 11
29
finding and bringing a previous
instance of a window to the forefront
and identifying phone-capable
devices.
Native Controls for New
Hardware
FIGURE 3 | Jot IME
FIGURE 4 | Socket scanner device
Support for more controls is now
built into the RAD IDE of PocketBuilder.
Included in the ranks alongside the biometric scanner and symbol scanner are
the camera, GPS (global positioning
system), and socket scanner devices
(see Figure 4). These controls can be
added into the object definition and
used easily. If you have already used
and developed for PocketBuilder and
have been checking out CodeXchange,
you’ll recognize that some of these were
created in the last six months and distributed as interface DLLs. However,
they have now been expanded and
“baked” into the PocketBuilder VM.
This means it’s even easier to use any of
these devices in your applications since
we’ve abstracted the complex vendor
APIs into simplistic PocketBuilder
objects.
For example, the Camera object was
originally devised for the HP and VEO
SDIO camera. Now, since it’s a native
control, the instantiation of the camera
object will enable developers to code for
other cameras such as those found in
the HTC manufactured devices using
IAStyle’s Camera wizard.
What’s Coming Over the
Horizon?
Unfortunately, there were a few
things that didn’t make it into
PocketBuilder v2.0. One was the support for ADO.NET. This will give you,
the developer, the ability to access
Microsoft SQL CE databases, which is
yet more proof of our openness and
acute ability to listen to our customers’
needs. The other is remote debugging,
where the breakpoint that you hit is
actually on the device rather than in an
emulator within the application running in the IDE. Both of these will follow fairly quickly in a point release.
Last, the ability to receive SMS messages is coming soon, and this will be a
cool feature! ▼
ian.thain@sybase.com
~continued from page 10~
Enterprise Distribution of Your
PocketBuilder Applications
generation tool, and by the
name of the CAB inf file and
the processor type (always
ARM for Pocket-Builder
applications) the install is for.
If the name of the CAB inf file
is myapp.inf, the corresponding CAB file would be myapp.
arm.cab. This file has to exist
in the defined “Output Path.”
• The name of the output file
(the setup file for your end
users) is the application name
defined on the CAB Config tab.
Take care that you don’t use any
spaces in any of your path and file
names as this is not supported by
EzSetup. Make sure the radio button is checked and click the Build
button. If all your files exist and no
spaces exist in your path names,
you’ll get the setup file. Feel free to
execute it and browse through the
created installer. It will copy your
application CAB file to the location
30
PBDJ volume11 issue 11
defined in the registry key
HKLM\Software\Microsoft\Windows CE Services\InstalledDir, and
the next time your application will
be installed into your device by
ActiveSync automatically.
Conclusion
It’s a lot of fun programming
PocketBuilder, but until now it
was hard to create the needed
files to distribute applications to
end users in a professional way.
PocketBuilder has changed this
by providing PocketBuilder
developers with a CAB configuration tool. Developers will configure the creation of the CAB files
there and in a second step they
will create a professional-looking
setup file that will be distributed
to the end users. I wish you a
happy time PocketBuilding!1 ▼
pbdj@sys-con.com
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/
www.sys-con.com/pbdj/
For more details contact
Carrie Gebert
201 802.3026
carrieg@sys-con.com
PBDJ volume11 issue 11
31
Power Puzzle
Answers: page 34
Across––––––––––––––––––––––––––––
4. If an XML document is ___________, it
satisfies the XML syntax rules and can
be transmitted without the its schema
file.
6. A method for searching XML documents, which is not currently supported
by PowerBuilder, is _____.
8. The standard that is used to allow for
searching through a repository of web
services and retrieve their definitions is
known as ____.
10.XML documents are transformed into
other document types through XSLT.
The S in XSLT stands for _____________.
12.PBDOM is only available with the
_____________ edition of PowerBuilder.
14.The Export.XML._______ property
determines how (and if) the schema
definition for the XML is generated.
16.A web service is accessed through its
URL, or ______ Resource Locator.
18.DOM stands for Document ______ Model,
32
PBDJ volume11 issue 11
a document based method of parsing
XML files.
20.One way in which XML differs from
HTML is that in XML the tags are
_____________.
21.XML and HTML are both derived from a
much older markup language called
____.
22.XML stands for __________ Markup
Language
Down––––––––––––––––––––––––––––
1. The ____________ PBDOM function is
used to get the parent PBDOM_DOCUMENT object for a particular
PBDOM_ATTRIBUTE object.
2. The ___________ PowerScript function
can be used to determine if an XML document is well formed.
3. The _________ PBDOM method is used
to insert data into a PBDOM_ELEMENT.
5. ____________ instructions (PIs) are
embedded in ‘<?’ and ‘?>’ tags.
7. A _____ section is ignored by the XML
parser, and is useful for transmitting raw
data (e.g., binary files).
9. XML FO stands for XML _______objects,
a mechanism in which XML is transformed using XSLT into other document
types (e.g., PDF).
11.SAX stands for ______ API for XML, and
event driven model for parsing XML
documents.
13.The protocol that provides for the transmission of XML documents in response
to RPC called over HTTP is called ____.
15.The ‘<!--’ characters are used to indicate
the beginning of a ________.
17.In order for an XML document to be
_____ it must conform to the document
type description (DTD).
19.PowerBuilder uses a third-party XML
parser from Apache called _______ to
handle XML documents.
20.The _____ PBDOM function is used to
create a copy of a PBDOM_ELEMENT.
www.SYS-CON.COM/pbdj/
PowerBuilder News
All things of interest to the PB community
BY BRUCE ARMSTRONG
bruce.armstrong@teamsybase.com
THIRD-PARTY TOOLS
PowerGen 6.0
10/08 – E. Crane Computing
announced the release of PowerGen
version 6.0. PowerGen v6.0 is a
major upgrade to PowerGen v5.0,
adding support for PowerBuilder
v10.x, and continuing support for
PB v5.x, 6.x, 7.x, 8.x, and 9.x. It supports the Unicode implementation
in PB10 and can export from PB10
PBLs to pure ASCII source files and
can import ASCII files. Import,
Bootstrap Import, and Synchronize
are all available. PowerGen v6.0 also
expands PowerGen functionality in
several significant ways.
www.ecrane.com
Database Genius 2.0
9/26 – SV Software announced the
release of Database Genius 2.0, a
reporting engine that can be
embedded in PowerBuilder applications. The new version supports
nested reports, library lists, saving
reports as PDF, importing/exporting XML and CSV, multiple languages, and a data dictionary.
www.svsoftware.net/
smlPortal 3.0
9/17 – PowerObjects announced the
release of smlPortal 3.0, a tool that
allows IT organizations to rapidly
deploy PowerBuilder DataWindowbased reports and forms to the Web,
and is affordable to both small and
large companies. Using smlPortal,
Web developers achieve maximum
code reuse and a small learning
curve that allows customers to utilize
current development skills and current objects that are already deployed
in production environments.
www.powerobjects.com
PowerBuilder/PocketBuilder
See related “Mobile Village Awards”
below.
CORPORATE
eOffers
9/20 – Sybase announced the successful launch of eOffers, an
34
PBDJ volume11 issue 11
eGovernment online portal of the
commercial acquisition business
unit of GSA’s Federal Supply Service
(FSS). The enterprise infrastructure
and information management
solution provided by Sybase ASE,
an enterprise-class relational database management system, and
Sybase EAServer application server
on Linux has enabled eOffers solution at GSA to deliver a streamlined,
higher level of service by expediting
the FSS IT schedule contracting
process through online applications.
iANYWHERE
AvantGo for Ericsson P910
Smartphones
10/05 – iAnywhere Solutions (a
subsidiary of Sybase) announced
that it is working with Sony
Ericsson to provide AvantGo mobile
content to users of the new
Symbian-based P910 Smartphone.
Sony Ericsson Smartphone users
can now quickly and easily synchronize hundreds of mobile Web
sites containing news, weather,
sports, and entertainment, including content from many of the
world’s top media brands, using
either their desktop computer or a
wireless Internet connection.
Unwired Accelerator and
Unwired Orchestrator
10/04 – Sybase announced two
complementary new products to
rapidly mobilize and extend enterprise applications for the burgeoning mobile workforce. Sybase
Unwired Accelerator empowers
nontechnical users to quickly
mobilize without programming
Web applications, databases, Web
services, and other data sources for
delivery to a wide spectrum of
mobile devices for both connected
and occasionally connected access.
Mobile Village Awards
9/28 – Mobile solutions from
Sybase and its iAnywhere Solutions
subsidiary were recognized by
MobileVillage Inc., winning five first
place 2004 MobileVillage Mobile
Star Awards in the following enterprise software categories:
• Mobile developer tool:
Pocket PowerBuilder
• Mobile database:
SQL Anywhere Studio
• Mobile middleware:
M-Business Anywhere
• Mobile device management:
XcelleNet Afaria
• Wireless Web content provider:
AvantGo
Market Strategy Leadership
Award
9/22 – Frost & Sullivan presented
iAnywhere Solutions (a subsidiary
of Sybase) with the 2004 Market
Strategy Leadership of the Year
Award in the sales force automation
(SFA) mobile middleware market at
the Excellence in Mobile
Communications Awards Banquet.
Credited as the market leader in the
mobile database, device management, and middleware markets,
iAnywhere has over 9 million
deployed technology licenses for its
mobile and embedded database
products.
Mobile Lifestyle Survey
9/21 – AvantGo (a subsidiary of
Sybase) released the results of the
AvantGo 2004 Mobile Lifestyle survey. The survey reveals that when
it comes to device functionality,
early technology adopters want to
have their cake and eat it too.
When asked to imagine the “musthave” features of an all-in-one
“dream device,” survey respondents chose a surprising combination of “bells and whistles” and
standard options. The September
survey of 3,260 AvantGo users,
conducted entirely via PDAs and
smartphones, also revealed that
85% of Pocket PC owners and 82%
of Palm owners said that they
planned to stick with the same
operating system with their next
purchase.
ADAPTIVE SERVER ENTERPRISE
World’s Largest Data
Warehouse
10/04 – Sun Microsystems and
Sybase announced that they have
created the largest, verified data
warehouse in the world according
to an independent audit conducted
by InfoSizing, Inc. The Sun and
Sybase iForce Enterprise Data
Warehouse Reference Architecture
– consisting of Sun Fire servers, Sun
StorEdge storage subsystems, and
Sybase IQ, a highly scalable analytical engine – enables customers to
set up such highly scalable data
warehouses in days instead of
months, while also minimizing
storage costs.
ASE for Linux
9/08 – Sybase demonstrated its
commitment to the Linux community through the release of the
first free deployment version of
an enterprise-class Linux database: Sybase Adaptive Server
Enterprise Express Edition for
Linux. Now enterprises, the
developer community, and small
businesses will be able to build,
test, and deploy new applications
with no license fee, allowing
them to experience the substantial performance and cost-savings benefits of Sybase ASE on
Linux, recognized as the “Best
Linux Database” in the 2003
LinuxWorld Magazine Readers’
Choice Awards, and as the low
TCO leader over Oracle, IBM, and
Microsoft by the Standish Group.
Power Puzzle Answer Key
1
G
E
T
O
W
N
8
U
E
R
12
E N
D
O
13
S
C
O
U
14
M E T A
P
E
N
T
18
O B J E
B
J
E
22
E
C
T
2
X
W E L L F O R M
L
6
X P
7
A
C
9
R
F
D D I
10
S
O
A
T E R P R I S E
F
M
A
I
A
L
T
D A T A T Y P E
I
16
U N I F O
G
C T
20
C A S E S
21
S G M L
O
X T E N S I B L
E
4
3
A
D
D
P
C
R
T H
O
O
N
C
11
Y L E S H E E T
E
S
I
N
S
M
T
I
P
N
L
15
G
E
C
O
17
M
V
M
A
19
X
E
L
N S I T I V E
R
T
D
C
E
S
E D
5
A
T
R
E
E
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

Similar documents

PBDJ 11-5Y - SYS

PBDJ 11-5Y - SYS RAHUL JAIN, MIKE NICEWARNER, JIM O’NEIL

More information

English - SAP Help Portal

English - SAP Help Portal If a WPF application includes third-party controls and the required reference as­ sembly files are not in a build subfolder (..\bin\Debug or ..\bin\Release), when you publish it as a SmartClient ap...

More information