PowerBuilder

From Wikipedia, the free encyclopedia

PowerBuilder
Developed by Sybase
Initial release July, 1991
Stable release 11.1  (November, 2007) [+/−]
Preview release 11.0  (August, 2006) [+/−]
Written in C, C++
OS Microsoft Windows
Available in English, Japanese (Several languages supported for deployed applications)
Genre IDE
License Commercial
Website www.sybase.com

PowerBuilder, sometimes abbreviated PB, is a computer application development system created by Powersoft, which was later purchased by Sybase. Marketed 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 2007, the latest release of PowerBuilder is version 11. It includes DataWindow.NET, which is a .NET-enabled version of PB's DataWindow control. It includes ASP.NET 2.0 Web Forms application capability.[1]

PowerBuilder 10 and above use Unicode internally. This allows the use of characters from multiple languages concurrently. This affects the coding of API calls, however, the upgrade from PowerBuilder 9 to 10 automatically converts your existing API calls for you. Therefore, in PB10, you have a choice of making ANSI or Unicode API calls at the call level. PowerBuilder 10 supports reading and writing to flat files larger than 2 GB. PB9.0 supports the TRY CATCH FINALLY syntax of error handling. PB 10 has a built-in date-picker control.

[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. PowerBuilder remains in use at thousands of organizations around the world.

[edit] Language advantages

The PowerScript language supports Object-Oriented features of Inheritance, Polymorphism, and Encapsulation, but does not support importing from DataWindow, which is the main window that applications use. Powerscript does not require the use of these features, however- this gives developers the power of OO with the flexibility to develop using one's own strategy. Some developers use a framework, such as PowerBuilder Foundation Classes (PFC) [2], and from it inherit all objects such as windows.

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 subquery operations. 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 the user is 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:

DataWindow
this is the simplest, most powerful, and usually the fastest at runtime.
"Embedded SQL"
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 ...
"Dynamic SQL"
this is offered in 4 formats. The user builds a string which may optionally have bind variables. Dynamic SQL may be used 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, a dropdown of possible actions is not provided. 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. 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.

[edit] Footnotes

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

[edit] External links