Guest Editorial: A Brighter Future For PowerBuilder and Sybase
Guest Editorial: A Brighter Future For PowerBuilder and Sybase
Contents
Guest Editorial: A Brighter Future for
PowerBuilder and Sybase
by William B. Heys on Page 1
COM Knowledge:
COM+ Features
by Alan Walsh on Page 8
Distributed Ways:
Developing Jaguar Business Components
by Sean Flynn on Page 12
PFC Place:
Multi-Select Treeview
by Boris Gasin and Roy Kiesler on Page 25
Share Aware:
Sharethe Globals
VOL. 6 / ISSUE 4
by William B. Heys
The single most important event in my career was
learning PowerBuilder 1.0 almost eight years ago.
Since that time I have focused my career almost
exclusively on Powersoft (and subsequently Sybase)
technologies. I have experienced many emotions:
pleasure, challenge, frustration, and disappointment.
For the first few years I believed PowerBuilder was
truly the best of breed tool for developing client/
server applications.
Technology is changing at a rapid pace. Not that
long ago, nobody was thinking about Y2k or
developing applications for the Web. What a
difference two or three years can make.
Like many of you, I have been disappointed in
Sybases marketing message and technology over the
last couple of years. I thought the adaptive
component architecture message was too abstract
and not focused enough on solutions that clients want
and need.
More recently, the message seemed to be wait for
the next release. I jumped on the Distributed
PowerBuilder bandwagon in PowerBuilder 5 only to
discover it wasnt ready for prime time. The message
was Its a first step, wait until the next release.
Little Helpers:
EncryptX 1.3 by InnerDynamics Software
beginning on page 36
Page 1
Impressum
Contact addresses:
Editor:
Co-Editor:
Mark A. Lansing
Eichmatt 17
CH-6343 Rotkreuz / Switzerland
Fax: ++41 - (0)41 - 790 74 79
e-mail: [email protected]
On the web:
http://www.powertimes.com
Column responsibles:
Little Helpers:
Arthur Hefti
[email protected]
PFC Place:
Boris Gasin
[email protected]
Know How:
Bernie Metzger
[email protected]
Distributed Ways:
Sean Flynn
[email protected]
COM Knowledge
Alan Walsh
[email protected]
Subscription rates:
Individual:
User Group:
Page 2
Introduction
On Tuesday, June 15, Microsoft announced the
final release of the Application Specification for
Windows 2000, dubbed the Windows 2000 Logo
Program.
Thin Is In
But fat isnt out yet. Windows applications are
still created every day, with a richer set of features
than ever before. Surprisingly, though, these rich
clients have a significantly smaller footprint.
Thanks to tighter integration with new operating
system services, some of which are already available
under Windows 98/NT, these applications are trimmed down, leaner and meaner than their ancestors.
Take the newly released Office 2000 suite for example; after migrating from Office 97, I was pleasantly
surprised to find out that a standard installation of
Word, Excel, PowerPoint, Outlook and FrontPage
now consumes only 137MB of my disk space. The
previous installation of Office 97 used more than
200MB of disk space.
If you are serious about Windows programming,
you should familiarize yourself with the new application specifications, regardless of your intention to
obtain the logo for your application. The Microsoft
Windows Logo Program has nothing to do with the
strategy behind the application or its feature set. It
helps developers do a good job of implementing
functional specs, keeps them informed about the
latest innovations and provides a checklist for producing cutting-edge software. It also offers practical
suggestions on writing good Windows applications
that provide a consistent user experience and reduce
support and training costs.
The Basics
Windows Fundamentals
Provide 32-bit-only components
Do not add to or modify win.ini, system.ini, autoexec.bat or config.sys
Provide HTML-based help system
Page 3
(Continued on page 4)
User Interface
User Interface Fundamentals
Support standard system size, color, font, and input
settings
Provide documented keyboard access to all features
Ensure compatibility with the High Contrast display
option
Do not use
Black,
0, RGB(0,0,0)
Light Gray,
RGB(192, 192, 192)
Dark Gray,
RGB(128, 128, 128)
White,
RGB(255,255,255)
ls_mydocs, ls_filename
lul_token
SetNull( lul_token )
ls_mydocs= Space( 260 )
IF NOT ShetFolderPathA( &
Handle( this ), &
CSIDL_PERSONAL, &
lul_token, &
SHGFP_TYPE_CURRENT, &
ls_mydocs )
THEN
// handle the error
END IF
ls_mydocs += "myreport.psr"
GetFileSaveName( "Save", ls_mydocs, &
ls_filename )
Power Management
OnNow/ACPI Support
Respond to operating system sleep and wake requests and notifications properly
Page 4
Page 6
(Continued on page 7)
// ulong
// long
// Power Events
// -----------// Battery power is low
CONSTANT ulong PBT_APMBATTERYLOW = 9
// OEM-defined event occurred
CONSTANT ulong PBT_APMOEMEVENT = 11
// Power status has changed
CONSTANT ulong &
PBT_APMPOWERSTATUSCHANGE = 10
// Request for permission to suspend
CONSTANT ulong PBT_APMQUERYSUSPEND = 0
// Suspension request denied
CONSTANT ulong &
PBT_APMQUERYSUSPENDFAILED = 2
// Operation resuming automatically
// after event
CONSTANT ulong &
PBT_APMRESUMEAUTOMATIC = 18
// Operation resuming after critical
// suspension
CONSTANT ulong PBT_APMRESUMECRITICAL = 6
// Operation resuming after suspension
CONSTANT ulong PBT_APMRESUMESUSPEND = 7
// System is suspending operation
CONSTANT ulong PBT_APMSUSPEND = 4
References
The latest drafts of the Microsoft Windows 2000
Application Specification can be found on the
Microsoft web site at http://msdn.microsoft.com/
winlogo/win2000.asp.
For more information about the OnNow initiative
and other power management related issues, see:
http://www.microsoft.com/hwdev/onnow.htm and
the Microsoft Platform SDK Power Management
Reference at: http://msdn.microsoft.com/library/
sdkdoc/winbase/power_3v6t.htm.
_____________________________
1
In most cases, your application should always accept this request, unless, for example, it is right in
the middle of a transaction. Unfortunately, PowerBuilder does not yet have a pbm_power-broadcast
event mapped to this message.
Installation
Install/Uninstall
Install using a Windows installer package that passes validation testing
Identify shared components
Install to Program Files by default
Support Add/Remove Programs properly
Ensure correct uninstall support
Publish program information properly in the Start
Menu
?
Roy Kiesler is a Senior Lead Consultant at
Noblestar Systems in Cambridge, MA, a leading
provider of strategic information technology
business solutions. Roy has been working with
PowerBuilder since version 4.0, developing client/
server applications for the Pharmaceutical,
Financial Services and Tele-communications
industries. He is a member of Team Sybase a
group of highly proficient Sybase/Powersoft
product users, who volunteer their time to answer
questions in various support forums. Contact Roy
via e-mail at [email protected].
Conclusion
In this article, I introduced you to some of the basic
guidelines for developing PowerBuilder applications that are Windows 2000 compliant. Windows
2000 packs a slew of new and exciting features,
which undoubtedly, keep the members of the PowerBuilder developers team very busy, as they work
to make the next major version of PowerBuilder
Windows 2000 compliant.
Page 7
COM+ FEATURES
By Alan J. Walsh
Introduction
As I sit here getting ready to load Windows 2000
Release Candidate 1 on my machine, it occurs to me
that it might be high time to talk about COM+, the
latest version of Microsoft's architecture for component development. Many of you out there are now
on the COM and component bandwagon, and the
newest member of the Windows family brings many
changes in this area. Come with me as we take a
brief tour of these changes and what Windows 2000
has in store for application developers.
Get It Together
More than anything, I think COM+ is about
bringing together a bunch of stuff that has kind of
been floating around separately for a while. Perhaps
the biggest change in COM+ is the merging of
COM and MTS into one cohesive programming
model. Today we really have two models: the COM
model, which gives us the basic stuff like interfaces,
and MTS which adds an API and the plumbing to
support nifty things like distributed transactions, as
well as better support for security and component
management. COM+ has merged the two and we
New Look
Some of most obvious changes to COM are in the
user interface. For example, the MTS Explorer (and
indeed just about any mention of MTS at all) is
nowhere to be found in Windows 2000. Instead, it
has been replaced by the Component Services Management Console snap-in (see figure 1). This is
where both administrators and developers come to
do most COM+ related activities. Administrators
use Component Services to deploy and administer
components, while developers can use it to configure things like security and transaction support.
The user interface is nice, but the COM+ team
worked hard to make sure that all the functionality
in the Component Services snap-in is also available
through scripting. This makes it easier for both
developers and administrators to automate routine
tasks.
New Services
COM+ brings several new services for developing
applications. My personal favorite is load balancing. This is something that COM has desperately
needed for a long time, and unless you wanted to
write it yourself it just wasn't available. COM+
gives administrators and developers the ability to
deploy components on a "farm" of servers and have
client workload automatically distributed amongst
those servers. You designate one server as a component load balancing server (CLB). This machine
acts as a router - all client requests are sent here,
and it is your single point of failure. Microsoft
recommends that you designate a backup CLB server for fault tolerance. The CLB server keeps track
of servers in the farm and forwards the request to
Page 8
Page 9
Another powerful feature in COM+ is queued components. Microsoft introduced message queue services in the Windows NT 4 Option Pack with MSMQ
(Microsoft Message Queuing). Now COM+ developers have that same functionality available to
them. The idea is that your applications can make
calls to components whether they are online or not.
Requests are sent to a message queue and then
played back when the component is available. As
was the case with load balancing, there are some
restrictions that the developer must take into account when developing queued components. For
example, all parameters must be passed by value
and are in-only. This is an asynchronous kind of
(Continued on page 11)
Page 10
Conclusion
In conclusion, you can see that there is a lot that has
improved with the delivery of COM+. It is now
even easier for developers using any language to
build scalable and reliable distributed applications
on the Windows platform. COM+ retains the best
parts of COM and MTS and gives us a host of
powerful new services.
Events
There are times when it would be nice for your
application components to be automatically notified
when something happens. Anyone familiar with
Windows already understands events, and now
COM+ brings events and event services to components. With COM+ events, developers can utilize a
simple publish and subscribe model to allow their
components to be notified when something interesting or important happens. It uses late binding, so
subscribers are identified after the event happens,
and then COM+ sends the notification via standard
COM calls. As with queued components, method
parameters are in-only. The notifier will not be
waiting around to hear back from the client.
?
Alan Walsh works for Indiana University. He can
be reached at [email protected].
IMDB
The last new service that I want to talk about
attempts to solve a problem that developers have
had for a long time when creating server components: how to decrease access time for databases.
COM+ solves this problem with something called
IMDB: In Memory DataBase. The idea is that you
can load a copy of your data into memory either at
startup or at some other time that you decide.
Because the data is in memory, access is extremely
fast. You are only constrained by the physical memory on your server. In addition to fast access,
IMDB provides a simple and standard ADO/
OLEDB interface and transaction support.
Page 11
Introduction
In the previous two issues of PowerTimes we have
demonstrated a sample application working in Client/Server, Distributed PowerBuilder and COM/
MTS modes of operation. In this issue we use the
same sample application with the Jaguar component
transaction manager that is part of Sybase Enterprise Application Server (EAServer). In addition to
demonstrating a PowerBuilder client accessing a
Jaguar component, we will also look at accessing
Jaguar components from other environments including as a COM object from Microsoft Active Server
Pages (ASP).
provide an extremely compelling package for developing distributed applications, especially when the
development tool used is PowerBuilder.
Jaguar Server
PowerBuilder
Business
Component
Java
C/C++
Business
Component
COM
Jaguar Overview
Page 12
the COM Component Generator build, I still encountered other errors. The errors were caused by
methods that have arguments with unsupported
datatypes (e.g. any). Ironically the Jaguar Component Generator simply displays a warning message
stating that the offending methods will not be supported on the component and continues with the
generation. Unfortunately the COM Component
Generator generates errors and stops the build.
Hopefully this will be fixed in a future release (read
please fix this!). To work around this issue I created
a wrapper NVO (n_cst_bso_order_component) that
only contains the public methods necessary for the
distributed COM component. Finally I was able to
successfully build using both the COM Component
Generator and the Jaguar Component Generator.
I ran into an additional issue when attempting to
access the COM component from ASP. I traced this
down to a compilation switch in the COM project
that controls how reference arguments are passed to
methods. The switch is called Reference Arguments as Variants which is located on the
Objects tab within the Properties dialog for the
COM/MTS Component Generator project. When
this switch is turned off the PowerBuilder client can
successfully call the COM component, however, the
ASP client cannot. When this switch is turned on
the ASP client works but the PowerBuilder client
does not. Hopefully I will have more information on
this issue and the others that I encountered by the
time I give my presentation at the TechWave conference in Orlando.
Component Invocation
Invoking a Jaguar component is exactly the same as
invoking a Distributed PowerBuilder component,
and since the sample application was developed
from the beginning as a distributed application we
do not have to change any of the client code. All we
have to do is simply change the appropriate INI file
settings to point to the Jaguar server. The Driver
value in the INI file is set to Jaguar and the
Application value is set to the name of the package
(order) in which the component was installed in
Jaguar. Additionally a user-id and password must
also be specified. This facilitates the implementation of role based security within the Jaguar server
independent of the database, network and operating
system security.
Sample Application
As with the other articles in this series, the sample
application is a simple order/entry system based
upon the PowerBuilder Demo database. The only
difference this time is that I used PowerBuilder 7.0
as opposed to 6.x in the previous examples. I have
included a new library (JAGUAR.PBL) that contains the Jaguar proxy object for the business component.
Page 13
Server
Proxy
Client
App
Jaguar
COM
CORBA
IIOP
Component
Component
Summary
Sybase has made significant gains in the area of
distributed application support with the release of
EAStudio and EAServer. Not only do these products provide a robust and open environment, they
also make it extremely easy to build distributed
applications. This allows organisations to leverage
existing skills sets while at the same time creating a
component environment that dramatically increases
object reuse. This is becoming more important as
companies build Internet applications that need to
share the same components that internal systems
use.
TechWave 99
Once again Im plugging my session that I will be
presenting at TechWave 99 in Orlando. The session number is AD251 and will be presented at 3:30
rd
on Monday August 23 . The session will include
many of same topics I have covered in this article
series including architecture and design issues for
distributed applications and the various technological solutions that are available. Topics include application partitioning, object set management, business rule implementation, data access abstraction
and transaction state management. Distributed implementation tech-nologies covered include JaguarCTS and Microsoft Transaction Server. Web
application servers will also be demonstrated including Microsoft Active Server Pages. The presentation runs long, so plan on staying late if you want to
ask questions.
?
Sean Flynn is a Managing Partner at Infinity
Systems Group, a Boston area consulting and
training company specialising in distributed
systems design and development. Sean was the
principal developer of the Riverton OpenFrame
distributed business object framework. Sean is a
CPD Professional, member of the CPD Review
Committee and sits on the PowerBuilder Customer
Advisory Board. Sean can be reached at
[email protected] or by voice at 001-978287-5332.
Page 14
CYRANO ClientPack
Comprehensive Automated Software Quality
solution for PowerBuilder developments
Key Features of CYRANO ClientPack
Delivers a complete suite of integrated tools for managing and control-
http://www.cyrano.com
Page 15
Introduction
Recently I migrated a large Distributed PowerBuilder 6.5 application to PowerBuilder 7.0 and Enterprise Application Server 3.0. Having tried, in the
previous versions of PowerBuilder, to use Jaguar
CTS, I was pleasantly surprised by how easily one
can now deploy PowerBuilder components to EAS,
and how smooth the migration process can be.
Nevertheless, there are some significant architectural differences between DPB and EAS. Many of the
difficulties we encountered during migration could
have been minimized if we had known more about
these differences before we started.
I have even learned some things I wish I had
applied when we developed the original DPB architecture. The purpose of this article is to describe
many of the issues and challenges we confronted
during this process, in the hopes you are able to
have an easier and successful migration.
Page 16
Instance Pooling
EAS supports instance pooling of components,
where component instances can be kept in a pool
and reused without being created and destroyed
with each use. Support for instance pooling can be
set separately for individual components.
If an EAS component supports instance pooling,
once it is constructed, is kept in the instance pool
Page 17
Page 18
When I first started using Distributed PowerBuilder, I was under the mistaken impression that only
the server application could have an application
object and that individual DPB client sessions running on the server did not. For this reason I believed
it was impossible to use global variables within
remote client sessions.
Subsequently, I discovered that each client session
has a copy of the DPB servers application object
created for it, although the open and close events
are never triggered. All server-side objects created
within the client session have access to this application object and can reference its global variables.
For this reason you can declare your own global
variables or use the default global variables such as
the SQLCA transaction object within your DPB
server components.
The PowerBuilder any type is unique to PowerBuilder and cannot be used as the datatype for an
argument or return value for any public method of
an EAS component. CORBA does in fact have an
any datatype, but EAS does not currently support it.
Page 19
Benefits of Encapsulation
?
Bill Heys (CPD, CPI) is a Senior Consultant at
Whittman-Hart, Inc. in Lexington, MA. Bill will
be speaking at the Sybase TechWave conference in
Orlando and at the Swiss Sybase and PowerBuilder
User Group meeting in Zurich on October 21. You
may write Bill at [email protected].
Summary
In this article I have tried to describe some of the
important issues you will need to understand when
you migrate a Distributed PowerBuilder application
to use Enterprise Application Server. In future co-
Page 20
Introduction
The following discussion analyses database update
failures in dynamically generated datastores and
DataWindow objects. Powerbuilder documentation
regarding similar issues is reviewed and a fix is
proposed that corrects the problem.
Problem Description
The update problems discussed below were encountered during development of an application window
designed to correct data entry errors in a critical
data field, the employee ID number, contained in a
range of database tables. The authors chose to use
dynamically created datastore and DataWindow objects for this purpose in order to minimise the
maintenance required to accommodate future changes to database tables and the addition of new
tables.
The application was built using Powerbuilder 5.0.04
and PFC. The application serves as a front end for
a DB2 database.
The window functions by querying the database
system tables to identify tables containing the subject columns and then creating a datastore dynamically for each relevant table to implement updates.
DataWindow objects were also generated dynamically for each datastore using SyntaxFromSQL()
and Create() functions.
Initial tests of this window resulted in erratic update
failures. Upon execution, the PB update() function
returned errors (return value of 1) for 10 of 43
tables in which changes were applied. However,
following implementation of the fix outlined below,
all 43 tables were successfully updated using the
dynamic datastores.
store containing a dynamically generated DataWindow object. The user noted that this problem occurred when tables had defaults associated with at least
one column. This case involved an application built
with PB 5.0.02, going against a MS SQL Server
database.
To resolve this issue, the PB Technical Personnel
advised the user to list specific column names when
building DataWindows on the fly, instead of employing the wild card character, e.g.:
SELECT column_1, column_2,
FROM
instead of
SELECT *
FROM
However, application of this technique did not correct the update problems in our case. Update failures continued regardless of which form of SQL was
used.
Analysis
The update failures were investigated further by
examining SQL syntax issued to the database. A
messagebox was placed in the datastore's SQLPreview event for this purpose.
This revealed two problems. First, in cases where
updates were failing, the update SQL statements
generated by the DataWindow objects did not contain key columns for the relevant tables in the
WHERE clauses. This occurred despite specification of option 2 for the DataWindow's
Table.UpdateWhere property requiring use of all
key and modified columns.
PB Documentation
In other words, the DataWindow issued the following type of SQL string for updates:
UPDATE target_table
SET modified_column = 0002
WHERE modified_column = 0001
In the reported case, both the Retrieve() and Update() functions failed (returned 1) against a data-
instead of
Page 21
UPDATE target_table
SET modified_column = 0002
WHERE key_column = XXX
AND modified_column = 0001
Solution
The update failures were corrected by adding code
in the datastores DBError event and at the point in
the main window where updates are executed. This
code avoids interruption of processing when the
double update bug occurs.
It should be noted that in our application every
update was preceded by a retrieve. It was therefore
certain that database records corres-ponding to the
WHERE clause in the SQL UPDATE statement
existed in all cases, so that the double update bug
was the only possible reason for an update to return
an error code of 100. This may not be true for other
applications.
Conclusion
The preceding article describes datastore update
failures that occur sporadically with dynamically
generated DataWindow objects. It appears this is
caused by the DataWindow objects inability to
identify key columns for certain database tables. In
such cases, the DataWindow generates an error
code of 100 when it sends the update SQL statements to the database a second time.
A fix is outlined for this problem that is effective
but less than optimal. The authors would be interested in learning whether other developers have
encountered similar problems and, if so, what techniques were employed to resolve the issue. In addition, since this problem occurred using Powerbuilder Version 5.0.04, we are curious to know whether
subsequent versions of Powerbuilder also include
the double update bug.
Page 22
?
Gene Steiker is the principal of GDS Associates and is currently Project Leader for a PowerBuilder/
Oracle project at a large university. Previously, Gene has worked on Powerbuilder applications for
corporations in the financial services, telecommunications electronics, and health services fields. Gene
can be reached at [email protected] .
Alan Staub is a Senior Programmer/Analyst with Salomon Smith Barney currently working on
applications utilizing Powerbuilder and DB2. His previous experience includes development of
Powerbuilder applications at various firms utilizing a variety of databases. Alan can be reached at
[email protected].
Stop searching...
Course:
Date:
Location:
+41-71-670 01 60
+41-71-670 01 71
http://www.raksoft.ch
Sybase System Integrator - IBM Business Circle Partner - Riverton Software: HOW Partner
Page 23
7RROV
&OLHQW6HUYHU
'HYHORSPHQW
- Custom made Software in any Business
Area
,QWHUQHW
(QWHUSULVH, 1HW
'HYHORSPHQW
- Custom made Web Sites
+ Easy to maintain
+ Fast Development
+ Public Hosting available
'HYHORSPHQW
- Custom made Web
Sites for Intranet and
Internet usage
7UDLQLQJ
- For Sybase AG and 5HVDOH
- ColdFusion
SQL AG
- HomeSite
- ScriptBuilder
&RQVXOWLQJ
- On various PowerBuilder Topics
6\EDVH&$33DUWQHU
&ROG)XVLRQ5HVHOOHU
5HVDOH
- SilverStream Reseller
6LOYHU6WUHDP9$5
3DJH
MULTI-SELECT TREEVIEW
by Boris Gasin and Roy Kiesler
Introduction
As I frequent the newsgroups and mailing lists one
of the treeview-related questions comes up over and
over. How do I enable multiple selection in the
treeview? Unfortunately, by design , the PowerBuilder Treeview control does not support multiple
selection. Or does it? This months column will
revolve around the treeview control, specifically the
ability to provide multiple item selection.
The Requirement
The idea of a multiple selection in a navigation
control may seem strange to some. After all, the
treeview was intended for navigation. This can be
seen in the standard Explorer interface. See Figure
1 below. If you need selection, well thats what the
listview is for.
Page 25
Making it Work
The biggest implementation challenge has to do
with the selection of the tree view items. Specifically, choosing the correct event to select the checkbox. The checkbox or the radio button picture
should be toggled when it is clicked. If item selection is performed from the treeview clicked event,
the checkbox or a radio button would be toggled,
but the item state picture will also be toggled when
the treeview is clicked anywhere on the item. A
second problem is that there is no way to select an
item from the clicked event without causing the
focus to change to the new item. The Option Tree
treeview provides two distinct functions navigation and selection. Mixing these two functions and
causing the selection to affect the navigation would
Page 26
TVHT_ONITEMBUTTON
TVHT_ONITEMICON
TVHT_ONITEMINDENT
TVHT_ONITEMLABEL
TVHT_ONITEMRIGHT
TVHT_ONITEMSTATEICON
TVHT_TOLEFT
TVHT_TORIGHT
Page 27
Conclusion
In this article we have demonstrated a PFC based
implementation of a multiple-selection/option
treeview control. The code and examples shown in
the article were kept simple to demonstrate the
techniques involved. If you are going to implement
this in your extension to PFC, you might want to
consider moving it into a Treeview service.
While the utilisation of the new metaphor is
straightforward, the real question is when should
this approach be used instead of a more traditional
treeview / listview or treeview / DataWindow combination approach? As previously mentioned, the
main purpose of the treeview control is to provide
hierarchical navigation. However, there are cases
when the last treeview level represents some data.
This data level, as well as operations the application users will need to perform on this data, determine which approach is more appropriate. If the
data needs to be presented in a number of different
ways, if it needs to be sorted, filtered, or processed
in some other way then stick with a listview or a
DataWindow approach. If multiple selection is required and data itself does not require a complex
presentation, the Option Treeview may be a good
candidate.
Page 28
Tool
of the
m o nt h
Client-Server
Datenbanken
Services
PowerBuilder 7
PowerGen
PowerDoc
PowerGen's breakthrough
technology gives you
unprecedented flexibility and
speed when you building
PowerBuilder applications.
Recreate your libraries (PBLs)
from object source. Use
PowerGen to produce all your
PowerBuilder deliverables in a
single step.
Am Borsigturm 48
D-13507 Berlin
Germany
Phone: +49 (0)30 430 323 50
Fax: +49 (0)30 430 323 55
Email: [email protected]
PB Spy
ImagN
Page 29
Introduction
Ever since I can remember I have heard the same
thing regarding global variables DON'T USE
THEM! Everywhere I have been it's the same story,
"don't use global variables global variables are
bad ". During technical interviews I have been
told repeatedly that global variables are really bad.
We all seem to agree that global variables are not
good, but it still seems that they make their way into
applications. I can't remember the last architecture
I saw that did not use a global variable of some type.
Even the PFC, which is touted for its object oriented
design, abuses the rule of no global variables. This
article will discuss a technique that will allow you
to eliminate the use of global variables in your
application code once and for all.
Mis-Behaving Globals
Niki is a senior developer on a project and has a
particular result set that she needs to share in
multiple windows throughout her application. She
decides to create a global DataStore to hold this data
and then she uses the ShareData function to share
the data with her windows that require the data.
Holli is a newer developer on the team and has a
similar requirement to share a common set of data
in multiple places in the application. She takes the
same approach as Niki and creates another global
DataStore variable to cache DataWindow data. After developing a few modules using the DataWindow caching technique, Holli notices that rows
could be added to, or removed from, the table
during the running of the application. She decides
to add an embedded SQL call to count the number
of rows currently in the table and compare that with
the rowcount in the global DataStore just prior to
the ShareData call. If the number of rows currently
in the table and the DataStore rowcount are not the
same she re-retrieves the DataStore before calling
ShareData.
Niki notices what Holli is doing and thinks this
would be good logic to add to the modules that she
has already developed. She makes code changes to
all the modules she has written that use the DataWindow caching technique.
Other developers on the team that have been using
global DataStores for DataWindow caching notice
the actual rows in their result sets may also change
during the running of the application. They decide
to add embedded SQL to compare the current number of rows in the database with the DataStore row
count.
Just prior to deploying the application the developers find out there is a data model change being
implemented that is going to affect the SQL of all
the global DataStores that have been created for
their application. Not only does the SQL for each of
Page 30
Create a window with a command button that contains the following script:
Page 31
Constructor Event
Check to see if the DataStore has
been initially created
NOT IsValid(sds_NikisStuff) Then
sds_NikisStuff = Create DataStore
sds_NikisStuff.dataObject = "d_niki"
sds_NikiStuff.SetTransObject(SQLCA)
sds_NikisStuff.Retrieve()
End If
Conclusion
By using Shared Variables instead of global variables, the options are open to the developer when
change occurs. This article discussed the usage of
Shared Variables to replace global variables but it
also touched on the topic of working with components. We did not have to put the shared Variable in
an NVO; we could have placed it on a window. If
we had encapsulated the Shared Variable on a
window, however, we most likely would not be able
to freely reuse the functionality within a single
application, let alone start thinking of reusing it in
other applications.
rows
INTO
FROM <table> WHERE
matches DataStore>
If ll_currentRows &
<> sds_NikisStuff.RowCount() Then
Sds_NikisStuff.Retrieve()
End If
// Share the data
Return(sds_NikisStuff.ShareData(adw_1))
// Application open event
// Setup DataWindow cache
n_NikiCache lnv_cache
lnv_cache = Create n_NikiCache
// Everything is setupdestroy
Destroy lnv_cache
// Open event of window that requires
// the DataWindow cache
n_NikiCache lnv_cache
lnv_cache = Create n_NikiCache
lnv_cache.nf_share(dw_1)
// No longer need the NVO
Destroy lnv_cache
Page 32
ENCRYPTX 3.1
by InnerDynamics Software
Reviewed by Arthur Hefti
Introduction
Do you have applications that exchange data with
other applications but you cant use database replication? Do you use text files for this data exchange?
Do you ever worry about size and security, e.g.
everybody can see whats in these files? Well, EncryptX, by InnerDynamics Software, can handle all
these problems for you. It is an ActiveX that can
encrypt and compress your output.
Description
EncryptX uses the BLOWFISH Cipher to encrypt
the data. This method was designed by Bruce
Schneier who is a well-known expert in the field of
encryption. Mr. Schneier is also the author of the
excellent book Applied Cryptography, Second Edition, (John Wiley and Sons, 1996) which gives the
complete code and description of BLOWFISH as
well as that for most of the other encryption algorithms in use today.
Technically BLOWFISH is a 16 pass block encryption method that works in blocks of eight bytes.
During each pass the bits are shuffled in a pattern
that is different for each locking key. After 16
passes the bits appear completely randomized. However, the seemingly random bytes can be recovered by rerunning the algorithm with the same
encryption key
BLOWFISH is a symmetric block cipher that takes
a variable-length key, from 32 bits to 448 bits.
BLOWFISH was designed in 1993 by Bruce
Schneier as a fast, free alternative to existing encryption algorithms. Since then it has been analyzed
considerably, and it is slowly gaining acceptance as
a strong encryption algorithm. BLOWFISH is unpatented and license-free, and is available free for all
uses.
To compress the data EncryptX uses C-CADE, a
Page 33
Usage
The ActiveX comes with 5 functions: One for switching the component from trial to full mode, two to
encrypt and decrypt files and two to encrypt and
decrypt strings.
Once the EncryptX ActiveX is installed and registered on your machine, you can insert the control on
the window or user object you need to encrypt/
decrypt.
The usage of the encryption functions is quite simple.
Conclusion
EncryptX is an easy to use and powerful ActiveX
that gives your applications the possibility to use
encryption and compressions within a few minutes.
lb_Result=ole_crypt.Object.FileEncrypt( &
<InFile>, <OutFile>, <password> )
ls_Crypt=ole_crypt.object.DataEncrypt( &
<InText>, <password> )
Advertiser Index
Page
Name
Internet address
5
9
15
23
24
29
35
44
Sybase, Inc.
E. Crane Computing
Cyrano
RAK Software, Consulting & Publishing
CATsoft Development GmbH
PowerPeople
SYAP AG
SybSearch
www.sybase.com
www.ecrane.com
www.cyrano.com
www.raksoft.ch
www.catsoft.ch
www.powerpeople.de
www.syap.ch
www.sybsearch.com
Page 34
For More Information Fax back this reply, or call our sales team.
Name
Company
Function
Department
Phone
Fax
E-Mail
SYAP AG, Dorfstrasse 38, Baar CH-6340.
Phone: 041 760 5072 Fax: 041 760 1707 Web Site: www.syap.ch
Page 35
http://www.powertimes.com
http://www.geocities.com/SiliconValley/Bay/8680
http://www.ctpartners.com
President:
Debbie Arczynski
[email protected]
Vice President:
Bill Bitman
[email protected]
Secretary:
Gordon Giffen
[email protected]
Treasurer:
Fred Grau
[email protected]
Greg Dzingeleski
[email protected]
Page 36
Dan Murphy
Vice President:
Olga I. Demidova
[email protected]
Treasurer:
Karen Ness
[email protected]
Secretary:
Susan Thompson
[email protected]
Our staff, made up exclusively of Certified PowerBuilder Developers, has over 20 years experience
in securities processing systems and database design. We have worked on systems for trust accounting, shop floor management, personnel, and threetiered integration.
KEV Systems, Inc.
65 Stony Brae Rd.
Newton, MA. 02161-1728
Phone:
Fax:
Michael Baraz
Peter Vassilatos
Jeff Barnes
Nicky Petrila
http://www.cpbug.org
The Secretary of the ChicagoLand PowerBuilder
User Group, Jeff Barnes, can be reached at the
following e-mail address: [email protected].
Vince Fabro
[email protected]
614 - 220 7900
Vice President:
Jeff Kusner
[email protected]
614 - 213 5329
Secretary:
Jim Nelson
[email protected]
614 - 418 1748
Treasurer:
Todd Dake
[email protected]
614 - 418 1748
President:
http://www.cmhpbug.com
Page 37
Fax: 01.46.99.08.92
E-mail:
Tel:
Fax:
Internet:
[email protected]
+45 6313-6128
+45 6313-6199
http://www.sybase.dk/pbusgdk
http://www.njpbug.org
Phone:
Fax:
The members of the New Jersey PowerBuilder User
Group receive PowerTimes thanks to a generous
sponsorship from Dynamic Technology Group.
Page 38
973.402.5600
973.402.5620
http://www.dynamictechgroup.com
President:
Vice President:
Rick Pal
[email protected]
Ken Frohne
[email protected]
Conference Coordinator:
Ron Francis
[email protected]
Treasurer:
Nonie Cody
[email protected]
Secretary:
Ram Raman
[email protected]
Newsletter Editor:
Randeep Takkar
[email protected]
http://www.dyn-data.com
Dynamic Data Solutions provides expert application development consulting in the areas of traditional and web client/server focusing on integrated
solutions from the Sybase/Powersoft and Microsoft
families of products.
Come check our Tech Zone at http://www.dyndata.com/ims/techzone/techzone.stm for a searchable database of development tips as well as real
world examples of our expertise at work.
Eric Larson
(608)252-3385
Vice President:
Treasurer:
Secretary:
Webmaster:
Amy Jo Esser
Craig Cole
Bruce Meister
Jeffrey White
Internet:
Page 39
http://www.madpug.org
Deanna Townsend
[email protected]
VP:
Scott Cunningham
[email protected]
Secretary:
Angie Kemerly
[email protected]
Treasurer:
Bruce Kohl
[email protected]
Webmaster: [email protected]
Internet:
http://www.ipbug.org
http://www.cascadia-sw.com/nwpbug/
The NWPBUG officers are:
President:
Anirban Choudhury
[email protected]
Vice President:
Paul Gibson
[email protected]
Secretary:
Anil Batra
[email protected]
Treasurer:
Connie Butler
[email protected]
http: //www.serverlogic.com
Page 40
2. Den skal vre et kontaktpunkt mellom brukerne og Sybase Norge, nr det gjelder forslag til endringer/forbedringer av produkter
og relaterte tjenester.
EDB ASA
Avenir ASA
WM-Data
Hrens Forsynings Kommando
De Norske Bokklubbene
OCP AS
Sybase Norge AS
Tlf. 22 72 80 00
Tlf. 23 15 75 00
Tlf. 22 57 70 00
Tlf. 23 09 63 86
Tlf. 22 02 20 00
Tlf. 23 10 55 16
President:
Carole Hargrave
[email protected]
Treasurer:
Mark Jorgensen
[email protected]
Secretary:
Pauline Aubertin
[email protected]
Page 41
President:
Jay Hunt
[email protected]
Vice President:
Allen Phelps
[email protected]
Secretary:
Neal Bockwoldt
[email protected]
Treasurer:
Solutech maintains strategic partnerships with leading software vendors such as Microsoft, Oracle,
Rational, Powersoft and Sybase. These partnerships
give you a direct link to new product information
and on-going technology developments. Solutech is
a local extension of our vendors, bringing you peace
of mind in a constantly changing environment.
Dave Blankenship
[email protected]
Warren Clayburn
[email protected]
Treasurer:
Ian Soden
[email protected]
Secretary:
David Speight
[email protected]
Member:
Brick Du Bourg
[email protected]
Postal address:
Suite A8, Kebbell House
Carpenders Park
Watford, Herts. WD1 5BE
Page 42
E-mail: [email protected]
Fax:
0331/700189
Internet: http://www.telemacus.it/pbug/pbug.htm
L' abbonamento a PowerTimes per gli iscritti del
Power Builder User Group Italia e' stato gentilmente offerto da Sybase Italia.
CATsoft
Dear SPBUGS Member,
The Swiss PowerBuilder User Group and the Sybase
User Group Switzerland have merged to become the
Sybase and PowerBuilder User Group Switzerland.
Our first joint meeting (the 5th annual meeting of the
PowerBuilder section) will take place in Zurich on
October 21st. The main speaker will be Bill Heys, check
out the web page at http://www.spbug.ch for more
details.
As our president is resigning after 5 years we are
currently looking for new steering committee members.
If you are interested please contact the Secretary Mrs
Celia Hegarty by mailing her at [email protected].
Page 43
+41-55-616 51 11
+41-55-616 51 14
www.catsoft.ch
Page 44