PFC Guide Titlebar
HomeFAQLinksPFCMAGExtensionsDownloadWhat's NewSearch

PFC Extension Strategies

Table of Contents      


Introduction/Objectives

The PFC development team had taken on a very challenging task. Their goal was to provide a class library that met the requirements of every developer in a vast PowerBuilder community. Judging by the tremendous user community response it is clear they have succeeded. They have done so by intentionally omitting any functionality that would force a specific presentation style or would cause the framework to become inflexible. As a result, PFC has a lot of opportunities for extension.

The purpose of this paper is to discuss the practical application of the extension layer and other techniques used to customize PFC library. Although at first it may seem that by providing the extension layer PFC has dictated the exact method of extension, in reality there is still room for many choices. In fact, there are so many that the topic of extending the PFC remains the source of many debates.

One of the most important decisions on a PFC project involves the selection of the extension method. The choices made regarding the extension techniques are not easily reversed. The extension methods must be selected with care. Unfortunately the decisions related to extending the PFC architecture must be made on the very first PFC based project. As is the case with any class library, one of the first questions is: "Where do I place the code?". Finding the right event provides half the answer. You have to determine whether the additional logic belongs in the extension layer. This paper will provide some of the answers to these questions and will discuss different alternatives for the object extension. After completion of this chapter you should have enough knowledge to select the method most appropriate for your specific requirements.

The Extension Layer

PFC is distributed as a set of eight PBLs. All the PFC code is contained in four PBLs, the other four comprise an extension layer, see Figure 1 below:

Figure 1 - Extension Layer

The extension layer is intended to allow us to make application specific changes without affecting the base class objects. Lets examine how the concepts are implemented in PFC. Each object in PFC layer has a corresponding descendant in PFE. There is no code in the extension layer objects, it is intended as a placeholder for any custom logic. The descendant objects in PFC are inherited from the ones in PFE. The relationship between the objects in the PFC and the extension layers is shown in the Figure 2 below.

Figure 2 - Extension Layer Object Relationship

The circular relationship between the two layers provides the ability to modify any object without placing the code directly in the class library.

In order to come up with an extension layer mechanism best suited for your needs, you must be aware of the different extension techniques, the different types of logic you are going to add to PFC, and finally the extension requirements specific to your environment.

Table of Contents     Next Page

Article based on the material from "PowerBuilder Foundation Class Library Professional Reference", McGraw Hill, ISBN 0-07-913267-7.

Last revised: February 15, 2004 03:58 AM.