PowerBuilder 11.0 .NET Quick Reference Guide

SQL Anywhere 10 (for samples and tutorials) … If you want to integrate existing business logic in PowerBuilder custom class user … Although the PowerBuilder …

More PDF Content

PowerBuilder 11.0 .NET Quick Reference Guide PowerBuilder 11.0 .NET Quick Reference Guide Version: <0.2> PowerBuilder 11.0 .NET Quick Reference Guide This guide provides a quick reference to topics that you need to know when you attempt to deploy and run PowerBuilder applications as .NET applications. For complete information on a .NET feature, refer to the Deploying Applications and Components to .NET book in the PowerBuilder 11.0 online Help. 1 System Requirements 1.1 Development and deployment (with PowerBuilder 11.0 installed) Windows XP Professional SP2 or Windows 2003 SP1 .NET Framework 2.0 GA (version 2.0.50727) .NET Framework 2.0 SDK (for .NET Smart Client deployment only) Internet Information Services (IIS) 5.0 or higher (for .NET Web Forms and .NET Web Services local host deployment only) SQL Anywhere 10 (for samples and tutorials) Adaptive Server Anywhere 9.0.2 or SQL Anywhere 10 with MobiLink Synchronization (for .NET Smart Client MobiLink Synchronization feature only) 1.2 Runtime .NET Framework 2.0 redistributable files IIS 5.0 or higher configured for hosting ASP.NET 2.0 applications (for .NET Web Forms and .NET Web Services Runtime only) PowerBuilder 11.0 .NET runtime libraries. IE Web Controls (for .NET Web Forms runtime only) GNU Ghostscript (for .NET Web Forms runtime printing only) Special Note: If more than one .NET Framework version is installed, modify the system PATH so that the .NET Framework 2.0 appears first. If you install IIS after .NET Framework 2.0, you need to register ASP.NET 2.0 with IIS to enable hosting ASP.NET 2.0 (run aspnet_regiis.exe  i from the .NET Framework 2.0 installed folder). 2 Prerequisites 2.1 For existing PowerBuilder applications Before attempting to deploy an existing PowerBuilder application as a .NET application, you must determine the type of .NET target you want to use for your application. The following criteria will help you to determine the appropriate .NET target type: Small- or medium-sized reporting, inquiry, and simple transactional applications are ideal candidates for .NET Web Forms deployment. Large applications or intensive data entry applications are suitable for .NET Smart Client or .NET Windows Forms deployment. <01/11/2007 >
Page 1
of 10 PowerBuilder 11.0 .NET Quick Reference Guide Version: <0.2> If you want to integrate existing business logic in PowerBuilder custom class user objects (NVOs) with other systems, you can use the .NET Web Service or the .NET Assembly targets for your applications. For better performance, partition the NVOs and related objects into new PBLs and deploy them from a .NET Web Service or .NET Assembly project. After you select the .NET target type that you want, create a new .NET application target and base it on an existing PowerBuilder client-server application. 2.2 For new development With PowerBuilder 11.0, you can design and develop new applications and deploy them as .NET applications. For new development, create a new .NET target of your choice from scratch. Before developing .NET applications, refer to the Deploying Applications and Components to .NET book in the HTML Help for a list of unsupported PowerBuilder features in .NET targets. 3 PowerBuilder to .NET deployment basics 3.1 Dashes in PowerScript identifiers If a PowerBuilder application uses dashes in its identifiers (for example, int max-value or the window name w-employee), then the  Allow Dashes in Identifiers property must be set to true before you attempt to deploy .NET projects. This property is set to true by default. If it is not set to true, open the application in the Application painter, select Design>Options from the menu bar, select the Allow Dashes in Identifiers check box on the Scripts tab page, and click OK. 3.2 Refactoring unsupported features (common to .NET deployment) This section provides some basic refactoring tips for common unsupported features. For a list of unsupported PowerBuilder features in .NET targets, refer to the Deploying Applications and Components to .NET book in the PowerBuilder 11.0 HTML Help. 3.2.1 GOTO statement In .NET targets, the GOTO statement is not allowed to jump to a label with a different scope. The following code snippet causes deployment failure. if b = 0 then label1:  else  . end if goto label1 Refactor this code with an alternative approach . 3.2.2 Narrow casting not allowed Narrow casting (downcasting) is not allowed by the C# compiler. n_ds ds ds = create Datastore // avoid this <01/11/2007 >
Page 2
of 10 PowerBuilder 11.0 .NET Quick Reference Guide Version: <0.2> This code can be refactored as follows: Datastore ds //declare the variable of the same type as the object created. 3.2.3 Calling the base method of an indirect ancestor class in an override method is not allowed Suppose that there are three classes W1, W2 and W3. W1 inherits from Window, W2 inherits from W1, and W3 inherits from W2. Each of these classes handles the Open event. In the Open event of W3, it is perfectly legal to code W1::open() in PowerScript. The W1 Open event is triggered. However, in .NET targets, the w2::open() event is triggered. Therefore, you must refactor such code segments before .NET deployment. 3.2.4 The  finally clause The finally clause should not have a Return statement. If the finally clause has a Return statement, it results in a .NET project deployment error due to a C# compiler limitation. 3.2.5 Do not use  this pronoun in function objects A function object is essentially a static method of a class. Although the PowerBuilder compiler does not prevent you from using the  this pronoun in a function object, the C# compiler does not allow this. 3.2.6 Use PowerScript system functions instead of external functions. External functions are allowed in .NET deployment of a PowerBuilder application, but if PowerScript offers the same functionality, use PowerScript functions instead of external functions (for example, GetCurrentDirectory). 3.2.7 Issues with External functions Enough space should be allocated for a string parameter (using the PowerScript Space function), before passing the string to an external function by reference. The datatype of a parameter passed to an external function should be the same as the one declared for it. All external DLLs that are referred by external function calls must be added to the Win32 DLL list in the .NET Project painter or a runtime error will occur. 3.2.8 IsNull function limitation The IsNull function works for primitive datatypes only in .NET deployment. It does not work for structure or class objects. You can use IsValid as an alternative to IsNull for structures and class objects before attempting .NET deployment. 3.2.9 Naming conflict In .NET targets, the same name is not allowed for multiple objects, even if they have different types. 3.2.10 Consuming .NET assemblies in PowerBuilder Refer to the  Referencing .NET Classes in PowerScript chapter in the Deploying Applications and Components to .NET book in the PowerBuilder 11.0 HTML Help. <01/11/2007 >
Page 3
of 10 PowerBuilder 11.0 .NET Quick Reference Guide Version: <0.2> 3.2.11 Clipboard and drag-and-drop functions and are not supported in Web Forms targets Clipboard functions, such as the Cut, Copy, and Paste functions, are not supported in Web Forms targets. Drag-and-drop functionality is not supported in the browser environment. 3.3 Best coding practices for .NET deployment 3.3.1 Use of Yield function in .NET Web Forms targets The Yield function is executed at the server when used in .NET Web Forms applications and requires additional system resources as well as frequent postbacks to the server. Because this reduces the perfo
 

Download PowerBuilder 11.0 .NET Quick Reference Guide pdf from www.sybase.com, 10 pages, 136.99KB.