Thursday, October 30, 2014

Easy Programming With PowerBuilder

Make an application with powerbuilder is very easy. 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 is used primarily for building business applications. PowerBuilder was used by some companies in the financial and telecoms sectors where Java and Microsoft Visual Studio are more predominate.
There are a number of third-party tools that build upon and enhance the functionality of PowerBuilder, such as Appeon, Visual Expert, and Enable Multilingual.

PowerBuilder was originally developed by Powersoft in 1991. Powersoft went public in 1993 and was acquired by Sybase for $904 million in Sybase stock in 1995.In May 2010, SAP announced that it would be acquiring Sybase for $5.8 billion. PowerBuilder languished for a long time for several reasons:
  • Sybase's stock plummeted in 1996 after discovery of inflated sales reports, and many members of the original Powersoft development team left Sybase.
  • Competition from rival tools for building GUIs to databases, such as Microsoft Visual Basic, Microsoft Access and Delphi, reduced PowerBuilder's market share.
  • PowerBuilder was slow to move to the Web: long after rivals began to support Web development, it continued to be based on two-tier (traditional client-server) technology. Two-tier approaches, while allowing more rapid development, are inherently less scalable than N-tier solutions (such as Web-based database solutions).[citation needed]
PowerBuilder 12, through compatibility with Web technologies such as ASP.NET, represents an attempt to regain market share. In order to move developers to newer versions, PowerBuilder 12 provides utilities that attempt to simplify migration.
In December 2013 SAP announced the new version going directly to number 15 and released a beta version. Key features included support for the .NET Framework v4.5, MSS 2012, Oracle 12, Windows 8, OData and Dockable Windows.

Powerscript is an object-oriented programming language. Nearly all of the visual and non-visual objects support inheritance, polymorphism, and encapsulation. The programmer may utilize a common code framework such as PowerBuilder Foundation Classes, also known as PFC, to inherit objects from and leverage pre-existing code.[9]
The DataWindow is the key component (and selling point) of PowerBuilder. The DataWindow offers a 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 makes it easier for developers who are not experienced with SQL.
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.

PowerBuilder offers native interfaces to all major databases, as well as ODBC and OLE-DB, in the Enterprise version. There are many connectivity options that allow performance monitoring and tuning, such as:
  1. Integrated security
  2. Tracing of all SQL
  3. Isolation level
  4. Password expiration dialog
  5. Blocking factor
  6. Number of SQL statements to cache
  7. Use connection pool
  8. Thread safety
  9. Trace ODBC API calls
Due to the information about the database schema (such as primary key information) that are stored in PowerBuilder's data dictionary, the code required to implement data display and browsing is greatly simplified, because the dictionary information allows generation of the appropriate SQL behind the scenes. 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 approach, relying on automatically generated SQL.

"Embedded SQL"
Embedded SQL supports SELECT, INSERT, UPDATE, DELETE and cursors. This option is used when the developer desires more control than is available with the DataWindow option. Example:
 UPDATE my_employee SET STATUS = 'A';
 IF sqlca.sqlcode<>0 THEN ...

"Dynamic SQL"
This is a form of parameterized SQL, where the user builds a string that may optionally have bind variables. Dynamic SQL may be used to create cursors as well.

No comments:

Post a Comment