There have been some complaints about how little direction has been provided by Powersoft for selecting the appropriate extension method. After reading this article you may have an idea why. There is no single right answer. Powersoft has delivered a very flexible class library with an extension layer concept that allows many different choices. Making an educated decision requires a careful examination of your requirements, familiarity with the companys infrastructure, an object oriented background, and a working knowledge of PFC.
I have outlined the major PFC extension issues and has presented some pros and cons of different extension methods. There is a "catch 22". It is difficult to make a decision without knowing the implementation of each object in PFC. However it is not recommended that you start your first PFC project before selecting the appropriate extension method.
Which extension approach is the best? You are going to live with the consequences of this decision for the life of the project. Ultimately it is your decision and at this point you should have enough ammunition to answer the question. Research your requirements. Examine the benefits and the shortcomings of each approach. Weigh each benefit and shortcoming against the development and deployment procedures of your company.
If you are looking for an extension method to house a custom framework, the first extension method should be quickly eliminated. From its release PFC was marketed as a foundation class library for the development of application frameworks. It has exceeded everyones expectations and many developers will use PFC alone, but there is definitely room for expansion. PFE as an Application Layer method leaves no room for a framework. To rewrite the expansion code for each application is unacceptable.
The two layer - "PFE as a Framework Layer" approach provides a viable solution. It is especially attractive if you have a need to share PBDs or DLLs between multiple executables, have a common network location for the framework libraries. It does require for everyone involved to be very familiar with the Service Based Architecture techniques. Extension by Delegation can be used successfully to resolve many design issues. It can also be overused, resulting in growing complexity, event timing and inter-object communication issues. Nevertheless, because of its advantages this method is gaining in popularity.
The three layer approach is a mainstream solution. It is recommended by Powersoft and is the most flexible of the three methods. It allows extension by insertion, inheritance, or delegation for both application and framework layers. The disadvantage is the development environment performance. This performance speed varies based on the hard disk access speed. It may be more noticeable on a slow network. Testing a simple application such as Peat or Quick Start with an additional layer should give a good indication of performance. Keep in mind that the performance hit is only noticeable in development mode. The performance degradation in an executable is hardly noticeable.
The three layer approach is a choice of PFC based commercial class libraries. They cannot predict their customer base and have to allow further extension by insertion.
If your framework code is based on the insertion techniques, the three layer method provides the ability to easily move the generic code between the application and framework layers. This may come useful in "feature procurement" or multi-project conflict resolution. A new framework feature can be added to a single teams application layer. After being proven on one application it can be moved up to the framework layer. Once in a while teams may disagree on what should be added to the common framework. This often come up when one team is trying to reach a milestone and is not receptive to changes. In this case again a new feature can be temporarily placed on the application level until everyone agrees. These issues can also be resolved with revision control, but it is always helpful to have alternatives.
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.