| By Millard F. Brown | Article Rating: |
|
| September 1, 2004 12:00 AM EDT | Reads: |
5,840 |
PowerBuilder includes a powerful set of foundation classes to speed development. These classes are collectively known as the PowerBuilder Foundation Classes, or PFC. Part 1 of this article provides an introduction to PFC and shows how to use it. For the experienced PFC developer, I'll outline the more recent changes and additions to PFC in Part 2.
This article is not intended as a complete professional reference for PFC - that could be (and is) the subject of an entire book on its own. Nor is it intended as a tutorial, although there are code samples to show you how to use some of the features. What you'll find here is an overview of the architecture, objects, and services of PFC so that you can envision how to use PFC to make your applications more rich, powerful, and user-friendly.
Getting Started with the PFC
What Is PFC?PFC is a class library of precoded objects and behavior. PFC provides a head start to application developers as an "out-of-the-box" class library solution.
PFC contains no prebuilt templates. It's a set of base classes that can be extended to provide a more powerful or specialized set of classes. It is a true "foundation" library. Sybase designed PFC with the intention that it would be extended, even though many developers find the provided functionality of the PFC to be ample.
PFC is based on service-based architecture (SBA) and uses simple function calls to enable services. The result is a foundation class library with a great deal of functionality, flexibility, and reusability. It's worth noting, however, that the implementation of PFC uses layers of inheritance that tie many of the objects and references together and prevent individual objects and services from being used without including the majority of PFC objects in your application.
PFC provides basic windows, menus, and user objects. There are also additional user objects that provide services for the developer to use to enhance the functionality of any PFC application.
PFC is more than just the code; it's a complete package. As shipped with PowerBuilder 9, PFC includes:
- PFC Classes
- PFC Help
- PFC Sample Database
- Example program (located in the pfcexamples folder)
- PFC Start Wizard
- Tutorial
- Utilities: Library Extender, PFC Message Manager
What Is SBA?
PFC uses service-based architecture (SBA), which is a way of building relatively lightweight objects that delegate a great deal of functionality to service objects. Windows and user objects create instances of these nonvisual service objects and request functionality and processing from them. This maximizes the developer's ability to reuse and extend the service objects without needing to modify existing objects and without having to carry around the overhead of fat ancestor objects. See Figure 1 for how objects and services relate to each other.The traditional inheritance-based model of object construction utilized the capability of object-oriented (OO) languages to extend a base object's functionality by successively adding code in the descendants. This was an improvement over the older "copy-book"- based reuse model of non-OO languages, but there were some significant drawbacks. As the inheritance tree grew and different objects with slightly different capabilities sprouted, it became increasingly difficult to change behaviors, since where to put the new behavior in the inheritance tree was a critical question. In addition, the sheer size of the objects gave rise to the term "fat ancestor." A fat ancestor always carries along the overhead of all of its underlying code whether it needs it or not. It loads slowly and (especially in the 16-bit environment of the time) can cause the compiler to fail if it was too fat. Also, the developer was forced to choose an object out of the hierarchy to fit whatever specialized use was required. If the developer wanted to change the use of the object, it was necessary to replace it with another object from the hierarchy, and painstakingly recode all of his changes.
SBA allows you to do more with less. The ancestor simply carries "hooks" that allow it to make use of functionality contained in smaller, more efficient "service" objects. The service objects can be selectively enabled so that only those services that are actually needed are instantiated. This reduces load time and memory usage. "Object Choice" syndrome is eliminated - the developer uses a single base object and instantiates services as needed to provide desired functionality.
PFC's implementation of SBA uses instance variables in the PFC objects to provide references to service classes. The service classes are instantiated by calling a function, of_set
dw_1.of_setLinkage(TRUE)
Placing the code for the linkage service in the window open event ensures that all objects on the window have been fully instantiated. In cases other than the linkage service (which depends on multiple objects being fully instantiated) you would place the code to create a service in the client object's constructor or open event.
PFC Architecture
PFC is built as a set of visual and nonvisual objects with a layered design. PFC is based on two layers: the PFC and the PFE. Every object in the PFC layer has a descendant in the PFE layer. The PFC layer is where the actual code that implements PFC functionality is placed. The PFE layer is left empty for the developer to modify and extend as necessary. Objects in the PFE layer are named
Published September 1, 2004 Reads 5,840
Copyright © 2004 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Millard F. Brown
Millard F. Brown is vice president of Power3, LLC, a company providing consulting and training services for the enterprise. He has beend developing PowerBuilder applications since PowerBuilder 2 and is the co-author of two new PowerBuilder 9 books: PowerBuilder 9: Advanced Client/Server Development and PowerBuilder 9: Internet and Distributed Application Development.
- Why SOA Needs Cloud Computing - Part 1
- Cloud Expo and The End of Tech Recession
- The Transition to Cloud Computing: What Does It Mean For You?
- A Rules Engine Built in PowerBuilder
- Sybase Named “Silver Sponsor” of iPhone Developer Summit
- How PowerBuilder Got Its Groove Back
- The Cloud Has Cross-Border Ambitions
- Ulitzer Names The World's 30 Most Influential Virtualization Bloggers
- Ulitzer Named "New Media" Partner of Greatly Anticipated iStrategy Event in Berlin
- Risks and Enterprise Mobility?
- Steps for Success in Enterprise Mobility?
- Are Mobile Luddites Resisting Mobility?
- The Difference Between Web Hosting and Cloud Computing
- Sybase CTO to Speak at 4th International Cloud Computing Expo
- Why SOA Needs Cloud Computing - Part 1
- Cloud Expo and The End of Tech Recession
- The Transition to Cloud Computing: What Does It Mean For You?
- Five Reasons to Choose a Private Cloud
- Seeding The Cloud: The Future of Data Management
- The Threat Behind the Firewall
- Economy Drives Adoption of Virtual Lab Technology
- Tips for Efficient PaaS Application Design
- A Rules Engine Built in PowerBuilder
- Sybase Named “Silver Sponsor” of iPhone Developer Summit
- Where Are RIA Technologies Headed in 2008?
- PowerBuilder History - How Did It Evolve?
- The Top 250 Players in the Cloud Computing Ecosystem
- Custom Common Dialogs Using SetWindowsHookEx
- DDDW Tips and Tricks
- OLE - Extending the Capabilities of PowerBuilder
- DataWindow.NET How To: Data Entry Form
- Book Excerpt: Sybase Adaptive Server Anywhere
- Sybase ASE 12.5 Performance and Tuning
- Working with SOA & Web Services in PowerBuilder
- Office 2003 Toolbar: A New Look For Your Old PowerBuilder App
- Dynamically Creating DataWindow Objects






























