The BAPBUG Journal
Issue #2, May 1998


Welcome from our President
by Debbie Arczynski


Sybase News


Member Notes


Introduction to the PowerBuilder Foundation Class (PFC)
by Fred Grau, CPD


PFC Toolbar
by Greg Dzingeleski


Contact List


Welcome from our President

Welcome to the Baltimore Area PBUG newsletter. This is our second newsletter. Issue #1, March 1998 was a big hit!!! We received many compliments on how informative and useful it was. Each issue will contain insights and helpful tips and techniques that should help you on your way to developing exceptional PowerBuilder applications.
This newsletter is YOUR newsletter! We hope that it is stimulating and helps you in your quest for the answer to the ultimate PowerBuilder question that you have on your mind! By the way, what is your question? We would like to include in each issue a Technical Advisor's Corner in which your question can be answered, but we need to know what your question is. You can forward all questions to any of the technical advisors. Their phone numbers and email addresses are listed in the newsletter, along with all of the BAPBUG officers.
Please feel free to contact any of the officers if you have suggestions of topics for our bi-monthly meetings, concerns with the running/editing of the meetings or newsletter, or just comments in general. We also want to encourage you to submit small, medium, or large articles of interest to the PowerBuilder community. We would like to encourage you to submit any "PowerBuilder tips" that have helped you along your way and may help others.
We want to thank Greg Dzingeleski for volunteering to take on the enormous task of organizing and putting together this newsletter. Thanks Greg!
We hope to see you at our next meeting in June, and hope to hear from you soon!


April Meeting

Many thanks to Mark Pfeifer for presenting DataWindow Essentials, Bill Bitman for presenting Using Non Visual Objects for DataWindow Functions, and Susan Galli for presenting Beyond DataWindows. If you would like any more information about any of these topics, please feel free to contact them. Their phone numbers and email addresses are listed in this newsletter.

Next Meeting

Our next meeting is Wednesday, June 3rd at the OAG building at SSA. Sybase will giving the presentation From Here to the Web. At this meeting, you can leverage existing code, skills, and tools as you move your applications to the Internet. They will be giving us a detailed demonstration to show us how to get there quickly. Hope to see you there!

Future Meetings

The August meeting will consist of topics related to datawindows and the PFC. We plan to cover topics of interest to people who are using the PFC and those people who already have working applications and are not using the PFC.

Interested in speaking at a future user group meeting?

If you are interested in speaking on a particular subject, or would like to demo your PowerBuilder application that you have been working on, please contact Debbie Arczynski at (410) 796-9461 (or debbie@charm.net). There are openings for presentations or demos of any length from 10 minutes to 2 hours. Thanks!


BAPBUG Web Page

Please take a look at our new web page designed by Anne Sola. It has lots of information about the group itself, the officers, the agenda, events, jobs, and links to other PB web pages. It is located at: www.geocities.com/siliconvalley/bay/8680. If you have any suggestions and/or comments, please contact Anne Sola.


Sybase News

Powersoft Conference ’98

August 9 - 13, 1998

Los Angeles Convention Center

Los Angeles, California

At the annual Powersoft Conference, you can take advantage of the in-depth training and time-critical information you’ll find only at this one-of-a-kind event. Each registration fee includes:

Register Early and Save!

If payment received on or before Friday, June 12 $ 895

If payment received on or before Friday, June 26 $ 995

If payment received on or before Wednesday, August 5 $1,095

After Wednesday, August 5 $1,195

 

Coming June 1, 1998 - detailed information about session offerings in the Preliminary Agenda!

Call 1-(508) 652-1008 today for registration information, or visit the Powersoft Conference ’98 Web site at www.sybase.com/events.


To all PBUG Members,

Sybase, Inc. is pleased to announce the following discounts on education courses to all PowerBuilder User Members. To obtain these discounts, youmust call 1-800-8-SYBASE and provide the education representative with a membership code, otherwise, discounts will not apply.  To obtain membership code, please attend the bi-monthly meeting.

10 % on any Sybase Education classes

20 % on Powerbuilder and SKIL's CBT's developed by Sybase

10 % on any CBT's developed by 3rd parties

20 % on Sybase certification professional exams offered through either

Sylvan Prometric or Vue worldwide, and take Beta certification exams for only $50

Thank you,

Effie Panagiotakis
Sybase, Inc.


PB 6.0.01 Beta

The PB 6.0.01 Beta Release is available. You can register for the download at: http://www.sybase.com/products/powerbuilder/pb6001/pb601reg.html


Member Notes

I am looking to see if there is interest in forming a Baltimore Web Technology User Group. I would like to know what people think about this idea, what products to showcase and what the best location would be. Also, if you have any suggestions or are willing to help out, please let me know. You can log your e-mail address and comments on http://www.ctpartners.com/ug.htm or by sending a message to training@ctpartners.com.

I appreciate any interest and support you might have. If you can pass along this message to others who might be interested, I would appreciate that as well. If you have any questions, please let me know.

Mark Pfeifer - mpfeifer@ctpartners.com


There's a newsletter called PurePower which comes with a tip of the week and other information. You can get this emailed to you at the web site http://www.magicnet.net/purepower/. It's worth getting, not to mean that it's worth nothing, which is what it costs. Some of the tips can be useful.


I've been playing around with distributed powerbuilder in PB6 and I read something interesting I'd like to share. With PB6 you can make calls to a server asynchronously, that is you can make the call to the server and control is returned to the client. The server will process the call and then informs the client when it's done. In addition, it is possible that the same application can be both a client and a server. The leap I didn't make is that you can make an asynchronous call from your app to your app, in effect making your app multitask (I believe multithreading might be the correct term). A process can be started and run in the background allowing your user to do something else. I think this can be useful and is probably a good way for someone to start experimenting with distributed powerbuilder. I haven't heard Powersoft (Sybase?!, whoever) advertise this feature much, but I think it has some potential.

Greg Dzingeleski

 


Introduction to the PowerBuilder Foundation Class (PFC)

By Fred Grau, CPD

Introduction

This is hopefully the first in a series of articles about the PFC. The PFC has revolutionized the way PowerBuilder applications are developed. In my opinion, the PFC is the best framework ever developed for building PowerBuilder GUI applications. It also comes free with the Enterprise and Professional versions of PowerBuilder 5.0 and 6.0.

The first question about the PFC is should you use it. If you are about to develop a new application, the answer is yes. If you are maintaining an existing system, you shouldn’t include the PFC. There are too many interdependencies within the PFC to use in an existing system. That’s why the PFC is actually an application framework instead of a class library.

Advantages and Disadvantages of the PFC

However, even if you are maintaining an existing system, there are still many advantages in using the PFC including the following:

There are some drawbacks with using the PFC. First, the PFC is designed for developing new GUI-based applications. There are too many interdependencies to incorporate the PFC into existing applications. Also, because the PFC is object oriented using a "service" based architecture, there is a learning curve. Knowledge of non-visual objects (NVOs) and inheritance is required before using the PFC.

PFC Architecture

The PFC includes the following PBLs:

PowerBuilder 6.0 also includes pfcold.pbl which includes the obsolete PFC 5.0 objects.

You may have noticed that there’s a set of pfc… PBLs and a set of pfe… PBLs (in which Powersoft calls the extention layer). ALL of the code in the PFC are contained in the pfc… PBLs. There is no code in the extension layer. However, for each object in the pfc… PBLs, there is a corresponding descendant object in a pfe… PBL. For example, the ancestor datawindow object in the PFC is pfc_u_dw which resides in pfcmain.pbl. In pfemain.pbl resides u_dw which is inherited from pfc_u_dw. This architecture allows you to customize the PFC by making changes in the extension layer. Please note that all objects in the pfc… PBLs have a "pfc_" as a prefix.

What makes the extension layer (the pfe… PBLs) work is that all references are made to objects residing in the extension layer. For example, in pfc_w_master, we have the following instance variable:

u_dw idw_active // The active datawindow in the window

You notice that idw_active is declared of type u_dw instead of type pfc_u_dw. If you add a function to u_dw (i.e. of_getlist() ), then your window can invoke the function (i.e. idw_active.of_getlist() ).

Service Based Architecture

The PFC uses "Services" or NVOs to provide functionality. For example, u_dw (PFC’s ancestor datawindow) has 12 different services including sort, filter, row selection, and linkage. u_dw (in this example) is called the requestor because it requests the services to be performed. Each requestor has of_Set… functions that are used to request services. You pass TRUE to create the service and FALSE to destroy the service. For example, u_dw has a function of_SetSort(TRUE) to create the sort service. Either the Destructor or Close event of all of the requestor objects invoke functions (i.e. of_SetSort(FALSE) ) to destroy these services.

The requestor objects then delegate functionality, where appropriate, to the services. Using of_SetSort (TRUE) as an example, this service is declared as an instance variable (inv_sort) within u_dw. Then in the Clicked event of u_dw, the sort logic is delegated to inv_sort. To use this sort service the Clicked event will have the following script:

// Sort services.

IF IsValid (inv_Sort) THEN

// Notify the Sort service, since it may //have a request // to sort on column header

inv_Sort.Event pfc_clicked ( xpos, ypos, row, dwo )

END IF

Window Inheritance Hierarchy

Because of the use of extension layers, the PFC uses a very deep inheritance chain for windows. The diagram below to displays the window inheritance chain used in the PFC.

pfcchart

 

Pfc_w_sheet and w_sheet are called abstract classes because they are used to create windows. These objects are never instantiated (opened). Pfc_w_master and w_master are virtual classes because they are used to create the abstract classes. Any changes to pfc_w_master or w_master will affect all of its descendant classes.

When creating a new sheet window, inherit from w_sheet. When creating a response window, inherit from w_response. Anytime a new window is created, you are automatically using at least 5 layers on inheritance.

Conclusion

I have barely touched the surface on using the PFC. In subsequent articles, I will describe additional functionality including how to customize the PFC for your application.

Fred Grau is a PowerBuilder consultant and the only employee at Woodfield Technical Services, Inc. He is also a CPD and the treasurer for BAPBUG. He has developed a variety of PowerBuilder applications at locations including VIPS, HCIA, Blue Cross and Blue Shield of Delaware, and SSA. At the time this article was written, Fred was available for consulting services. You can reach Fred at (410) 893-9638 or fred1@flash.net.


PFC Toolbar

One of the things I've disliked about using the PFC is trying to find the object you want to place on a window in the PFC libraries. It's just a minor annoyance, but I thought it would be neat if you could put these items on the toolbar. A consultant I work with told me you can. I've customized my toolbar with a few things, but I wasn't aware you could customize it to place userobjects on a window. If you open poewerbuilder and right click on the toolbar and select customize you get the customize screen. Select the custom palette and drag a custom icon to your current toolbar. Up pops the Toolbar Item Command window. Within the special command box there are two buttons, one labeled 'Query…' and one labeled 'Report…'. The 'secret' is to try to customize either the window painter or a visual user object painter toolbar. In this case there is a third button labeled 'Userobject…'. With this button you can choose any user object to place on a window or visual user object. Most people will want to choose to place visual user objects because you can't place a non-visual user object. That would be silly and you get a message box telling you so.

The toolbar definitions are stored in the PB.ini file. I thought it would be simple to customize the toolbar for the PFC and cut that portion out of the ini file so others could use it. This should save the trouble of creating your own. A user object toolbar button searches the current library path for the user object name, so the location of the library is inconsequential and the toolbar is reusable. Gripe time. I think Powersoft used bad GUI design when they made the 'Userobject…' button invisible. I think I would have figured out this feature long before if the button, which is invisible on one instance of the Toolbar Command window and visible on another was simply disabled. For that matter I imagine the PFC gurus at Powersoft all have their toolbars customized and they could have included this in the standard Powerbuilder package.

Rather than putting the cryptic toolbar code in the newsletter you can get the 'ini file add-on' by emailing me at greg.dzingeleski@ssa.gov or on the BAPBUG web site by clicking here.


Contacts

BAPBUG Officers
President Debbie Arczynski debbie@charm.net (410) 796-9461
Vice President Bill Bitman bitman@jhuapl.edu (410) 792-6000
Secretary Gordon Giffen gordon-g@vips.com (410) 832-8300
Treasurer Fred Grau fred1@flash.net (410) 893-9638
Tech Advisor Robin Bates robin.bates@powercerv.com (703) 502-8383
Tech Advisor Susan Galli susan@annopolis.net (410) 987-2684
Tech Advisor Mark Pfeifer mpfeifer@sprynet.com (410) 499-8765
Web Co-ordinator Anne Sola anne-s@vips.com (410) 832-8300
Newsletter Editor Greg Dzingeleski greg.dzingeleski@ssa.gov (410) 966-3328

Back to Home Page

1