PowerBuilder

From Wikipedia, the free encyclopedia

PowerBuilder
Maintainer: Sybase
Stable release: 10.5  (August, 2006) [+/-]
Preview release: 11.0  (August, 2006) [+/-]
OS: Microsoft Windows
Use: IDE
License: Commercial
Website: www.sybase.com

PowerBuilder, sometime abbreviated PB, is a computer application development system created by Powersoft, which was later purchased by Sybase. Touted as a Rapid Application Development (RAD) system, it includes tools for drawing the user interface and reports, and accessing database content. The tools are provided in an integrated development environment that is the application developer's interface to the capabilities of the system.

Contents

[edit] Features

PowerBuilder has a native data-handling object called a DataWindow, which can be used to create, edit, and display data from the database. This object gives the programmer a number of tools for specifying and controlling user interface appearance and behavior, and also provides simplified access to database content. To some extent, the DataWindow frees the programmer from considering the differences between Database Management Systems from different vendors.

PowerBuilder also includes a scripting language, PowerScript, which is used to specify the application behavior when events occur. Events usually correspond to user actions, such as clicking on an element of the user interface, or closing a window.

As of July 2006, the latest release of PowerBuilder is version 10.5. It includes DataWindow.NET, which is a .NET-enabled version of PB's DataWindow control. PowerBuilder 11.0 is expected in the first quarter of 2007, and is planned to include ASP.NET 2.0 Web Forms application capability.[1]

[edit] Usage

PowerBuilder is used primarily for building business applications. There are also versions of PowerBuilder that can be used to build applications to run on mobile devices such as cell phones or PDAs.

PowerBuilder is used commonly by companies in the financial sector, in the United States, Canada, and the United Kingdom. It is also used by many government agencies. Although PowerBuilder's day as a major development tool has passed, it remains in use at hundreds of organizations around the world.

[edit] Language advantages

The PowerScript language supports Object-Oriented features of Inheritance, Polymorphism, and Encapsulation, but it does not force you to use them. This gives developers the power of OO with the flexibility to develop using your own strategy. Some developers use a framework, such as PowerBuilder Foundation Classes (PFC) [2], and inherit all their objects, such as windows, from it.

The DataWindow is the key component which makes PowerBuilder so powerful. The DataWindow offers a powerful, visual SQL painter which supports Outer Joins, Unions and subqueries. It can convert SQL to Visual representation and back, so the developer can use native SQL if desired. DataWindow updates are automatic -- it produces the proper SQL at runtime based on the DBMS to which you are currently connected. This feature saves the developer from a very tedious chore.

The DataWindow also has the built-in ability to both retrieve data and update data via Stored Procedures. The user picks the Stored Procedure from a visual list.

In fact, the Datawindow itself is so powerful, many PowerBuilder applications have no framework, or only use inheritance in a limited way, because it is not necessary.

Another key strength is its database connectivity. PowerBuilder offers native interfaces to all major databases, as well as ODBC and OLE-DB, in the Enterprise version. PowerBuilder applications tend to support multiple databases with relative ease. There are many sophisticated connectivity options, such as:

 1. Asynchronous operations (so a long-running query won't "lock up" the application)
 2. Static Binding on or off
 3. Integrated Security
 4. Tracing of all SQL
 5. Isolation Level
 6. Password Expiration Dialog
 7. Blocking Factor
 8. Number of SQL statements to Cache
 9. Use Connection Pool
10. Thread Safe
11. Trace ODBC API Calls

As a result of its sophisticated connectivity, and the efficiency of the DataWindow, PowerBuilder applications have been observed to outperform many other competing applications in terms of the number of seconds it takes to retrieve data from a database and display it to the user.[citation needed] Updates are also trivial to code in most cases (1 to 4 lines of code), and run extremely quickly. Here is a sample PowerBuilder update script:

dw_1.AcceptText() dw_1.Update()

PowerBuilder supports the following ways of interacting with a database:

1. DataWindow This is the simplest, most powerful, and usually the fastest at runtime.

2. "Embedded SQL" This is a standard which, surprisingly, is not supported by some big-name development environments. Embedded SQL supports SELECT, INSERT, UPDATE, DELETE and cursors. It is a convenient way to do a simple update. Example:

UPDATE my_employee SET STATUS = 'A'; IF sqlca.sqlcode<>0 THEN ...

3. "Dynamic SQL" This is offered in 4 formats. The user builds a string which may optionally have bind variables. You may use Dynamic SQL to create cursors as well.

PowerBuilder supports Active-X and OCX controls, both visible and non-visible. It also can use OLE Automation as a client. However, PowerBuilder supports only late binding, not early binding. Therefore, when using OLE Automation, you don't get a dropdown of possible actions. PowerBuilder can be a DDE client or server. This allows it to interoperate with other applications.

PowerBuilder can make Windows and third-party API calls, and, in general, works well with third-party libraries in DLL files, however it does not directly support callback functions.

PowerBuilder offers a "/pbdebug" runtime switch, which creates a log file. This can help track down a bug "in the field", as the user simply emails this log file to the developer. It has another feature which can log all SQL statements to a file. It also has built-in performance profiling, an integrated debugger, context-sensitive help, and an active newsgroup to provide support.

PowerBuilder applications are typically compiled to p-code, which is then interpreted by the PowerBuilder runtime. Although it can be compiled to machine code (called c-code), a typical business application does not run any faster. Only applications which do an unusually large amount of computations with little I/O are likely to benefit from compiling to machine code.

[edit] Critique

Although PowerBuilder can work well for quickly developing very large applications with enterprise-level databases, the deployment to machine code (c-code) for such application might take a considerable amount of compilation time by the developer. However, there is rarely a need for a developer to compile a PowerBuilder application to machine code, as PowerBuilder applications are typically deployed as interpreted code (p-code). The developer will ordinarily choose to deploy compiled p-code libraries (.pbd files) as separate files from the executable. Much like .dll's, this allows for application updates to consist of migrating only a single affected library. Even if it is desired to deploy an application to machine code, the compile only needs to be done once right before deployment and will not affect the development lifecycle of the application.

Extensibility of the language is also rather limited. The technologies provided to overcome this (ex. PowerBuilder Native Interface, or PBNI) are still rather tricky and buggy. To develop a solution that includes external C++ code may not only require a competent C++ developer, but also a PowerBuilder expert to guide the developer through the myriad of subtleties of the language and the PowerBuilder Virtual Machine.

PowerBuilder does not support reuse of compiled libraries. Reusable Powerbuilder components must be distributed with source code.

[edit] Footnotes

  1. ^ PB11.0 beta description
  2. ^ PowerBuilder Foundation Class Help page, from Ascension Labs

[edit] External links