Delphi 2 - A Comparison of Client/Server Development Tools; PowerBuilder vs. Delphi

By: Borland Staff

Abstract: Delphi offers performance vastly superior to PowerBuilder. And only Delphi offersintegrated coding, debugging, testing, and deployment of client/serverapplications to increase developer productivity and applicationstability.

A Comparison of Client/Server Development Tools; Powerbuilder vs. Delphi
By Michael Lant
Sphere Data Systems Inc.
NOTE: The views and information expressed in this document represent those of its author(s) who are solely responsible for its content. Borland does not make or give any representation or warranty with respect such content.

Summary: Rapid Application Development environments that use component architectures increase productivity and reduce maintenance.

Delphi Developers can easily create native Delphi components without having to switch development environments.
Delphi development teams build reusable components libraries so that they can create more applications resulting in exponential productivity growth.
Component based applications can be easily maintained.
Object-Oriented programming languages allow for maximum reusability and maintainability thus increasing developer productivity and application stability.
For any development tool to be successful as a RAD tool, it must be effective for both prototyping and production use. In addition, it must produce applications where the objects can be reused or enhanced in order to respond to business needs. Some of the criteria for a successful RAD tool are:
Cost effectiveness: Increases developer and end user productivity.
Reliability: The application development environment is stable. The applications it produces are stable.
Easy to Learn and Easy to Use: Combines a simple and powerful language with an intuitive and professional Interactive Development Environment.
Speed: Compiles quickly. Creates fast native machine code executables.

A. Programming Languages
One of the most neglected and yet most important area in any RAD tool is the programming language because it ties components together. Powerful programming languages:

One of the most significant productivity enhancing technologies available to software developers has been the advent of Object-Oriented Programming (OOP). Object-Oriented Programming enables customers to easily reuse and maintain code.

1. Object Pascal strengths
Borland has designed the Delphi Language to provide full Object-Oriented capabilities. Object Oriented Programming (OOP) is most important because it enhances productivity and reduces maintenance through confident code reuse. Small, independent, tested, and optimized code modules enable development to deliver quality applications more quickly.

OOP offers extensibility. This enables people to enhance objects to meet their specific requirements. Because Delphi is fully Object-Oriented you can subclass and modify any component or OCX to meet your needs.

Delphi also supports advanced features like exception handling and creating new abstract objects or data structures. These in turn allow the developer to model data in new ways and provide the business with new decisions support systems.

Conclusion: Delphi has the most powerful client / server application development language. It supports extensibility through object oriented development, full system integration through support of the Windows APIs and standards, and productivity through code reuse.

2. PowerScript limitations
PowerBuilder uses its own proprietary language called PowerScript, the syntax of which has been described as similar to C and/or Basic. Although it may share some lineage -- it is neither. The language has many limitations including but not limited to:

Not Object-Oriented
No Pointers
No Inheritance
No Exception Handling
No Run-Time Type Information
No Linked Lists
No Inline Assembler
No Set Handling and Enumerated Types
No Component Building

As a result of these limitations, Powersoft has had to extend the capabilities of the DataWindow by adding complicated functions which are extremely complex and difficult to learn. The appendix of the PowerBuilder function reference manual dedicates nearly 150 pages to describing the syntax and attributes used by only two of the most important DataWindow functions: dwModify and dwDescribe.

Also, PowerScript does not fully support Object Oriented constructs. For example:

you can't create your own components
you can't define default values for function parameters
protected and private inheritance are not supported
class static (e.g. =PB shared) data can't be public or protected
you can't declare classes within another class
you can't define your own enumerated types
pointers to variables and functions are not supported
you can't define a function type other than virtual
Therefore PowerBuilder code is not easily reusable or maintainable. This reduces programmer productivity and limits the extensibility of the product.

Conclusion: PowerScript is a proprietary 4GL language that is difficult to learn. PowerScript does not support Object Oriented constructs thereby not allowing the developer to create reusable custom components.

B. Component Creation
The component model of application building has been accepted by the development community as a way to reduce development costs and deliver customized solutions quickly. It is no longer cost effective to build everything from scratch. The ability to create or buy custom components expands the potential of any given development environment. This in turn means the developer can deliver more solid solutions to a given business problem.

1. Delphi's Reusable Components
Delphi incorporates an object oriented component model that allows for maximum code reusability and maintenance.
Developers create components from within the Delphi Environment.
A large number of Third Party custom components are readily available to provide specific functionalities. There exist over 1000 third party tools and component libraries.

Delphi's Visual Development Environment allows a developer to simply grab a pre-built component and drop it into an application. There are over 100 standard components that ship with Delphi Client/Server Suite 2.0 which enables rapid application development. Additionally Delphi can turn any OLE Control (OCX) into a custom component providing open access to a growing third party market. Today, Delphi developers have incorporated Microsoft's Internet Control Pack, WinInet and ISAPI functionality into applications in order to leverage client server application over the Internet.

Because Delphi is an object-oriented development environment, it is easy to create your own custom controls. Through Component Building Experts and Visual Form Inheritance, over 50% of Delphi customers are creating customized controls to extend the power and functionality of the environment to meet the changing business needs.

Figure 1: Delphi Client/Server Suite 2.0 has an extensible palette of over 100 components.

A key feature of Delphi is the ability to create new components as necessary from within the Delphi environment. Delphi components are written in Delphi. These new components can be as simple as an existing component with some added functionality, or a completely custom component that is based entirely on new code. Additionally, Delphi has an expert to build the skeleton structure of a component with a single click. Customized components meet the changing needs of the development team and can be reused in many different applications thereby increasing productivity and maintainability.

Developers constantly search out ways of enhancing productivity and leveraging the expertise of specialists; one way to do this is to utilize custom components written by third parties. There is a very large and rapidly expanding market of Delphi VCL components including enhanced database controls, Internet controls graphing engines, spell checkers, calendars, financial and statistical calculation engines, internationalization components, spreadsheets and many more. The healthy growth of the add-on component market is testament to the demand by the market place for component based solutions.

Once a Delphi application is compiled, the component becomes part of the executable and does not require external files as is the case with DLLs, VBXs and OLE components. There a several advantages to this approach - the most important of which are:

Simplified maintenance of applications.
Reduced costs due to versioning problems associated with installation of runtime environments on end user machines.

2. PowerBuilder Controls
PowerBuilder ships with a limited set of 22 controls covering only the most basic of design needs. In fact, a number of the controls such as Line, Oval, Rectangle and Round Rectangle are simply variations of a shape control and are useful for nothing more than form decoration. This effectively reduces the number of useful PowerBuilder controls to approximately fifteen.

PowerBuilder developers cannot create reusable controls that integrate into the PowerBuilder development environment. The lack of full Object-Oriented support prevents effective component creation and forces the PowerBuilder developer to use other products such as C++ or Delphi to create specialized DLL's. This forces the developer to have access to, and be skilled in, multiple development products.

Conclusion: PowerBuilder developers cannot effectively enhance their development environments by creating reusable components which in turn limits developer productivity.

C. Exception Handling
Summary: Application developers spend a lot of time "bullet-proofing" client/server applications to meet the demanding requirements of their customers.

Only Delphi provides easy to use exception handling mechanisms to help developers deploy robust mission critical applications.
Delphi, having been written in Delphi, takes advantage of its own exception handling. It is the most stable application development environment resulting in less down-time and more productive developers.
Exception Handling reduces the amount of code written thereby increasing developer productivity and decreasing maintenance costs.

In a perfect world there would be no mistakes: Client/Server applications would never encounter a problem; networks would never fail; hard drives would never run out of space; people would never attempt to divide by zero; and programmers would always write perfect code. When creating client/server applications it is essential to write code that is able to deal with the possibility of any process failing. Here is how a leading PowerBuilder developer describes the error handling capabilities of PowerBuilder:

"The PowerScript language is less than ideal when it comes to error handling, Most functions can diagnose errors, but with very few exceptions the default action is 'ignore the error and proceed.' There are no debugging switches or compiler directives to change this behavior to 'trap all errors and halt.' With the exception of the global SystemError event, there is little language support for automatic error detection or handling, let alone any kind of 'on error then' construction that applies to a particular even or object.", Breck Carter To Check or Not To Check (Error Codes) PowerBuilder Developer's Journal - 1994 Special Issue
This lack of support from the PowerScript language makes it difficult, if not impossible, to create robust error handling routines without writing enormous amounts of code. In contrast, Delphi uses a more powerful error handling methodology. To understand how important this new approach is, we must first look at how it is done.

Fundamental to Delphi is the concept of exceptions. When an error occurs, Delphi instantiates an Exception object of that exception type. For example if a divide by zero error occurs an EDivideByZero object is created. All forms have built in to them the means of dealing with most errors. Rather than having to write code to test for every possible failure, the following construct is used:

   // statements 
   on Exception do
     // specific exception handling code here
     // default exception-handling code here

Delphi also allows developers to create their own exception types as follows:
  EpasswordInvalid = class(Exception);
This new user type exception is used simply as follows:
 if Password <>CorrectPassword then
   raise EpasswordInvalid.Create('Incorrect password entered' ) ;
Exceptions have capabilities far beyond this. For instance an exception class can be created to automatically log all SQL violations in order to audit trail important applications. It can also be used to trap null pointers in an application and then prevent a Windows access violation.

Conclusion: The exception handling construct provides enormous power and flexibility not available in PowerBuilder. It can significantly reduce the amount of code needed to create stable applications thereby shortening the development cycle. RAD Client/Server development tool stability and application stability should be a major criteria for the selection of a RAD tool.

Server Response from: ETNASC04