230 likes | 327 Views
PWB501 Powerbuilder Technologies in a .NET World. David Avera Staff Engineer davera@Sybase.com/334 501 1613 08/4-8/2003. The .NET World of Microsoft. .The Future According to Microsoft. Microsoft’s vision of Windows application development. An all encompassing environment with many benefits
E N D
PWB501 Powerbuilder Technologies in a .NET World David AveraStaff Engineerdavera@Sybase.com/334 501 161308/4-8/2003
The .NET World of Microsoft .The Future According to Microsoft • Microsoft’s vision of Windows application development. • An all encompassing environment with many benefits • Common runtime system • Type safe programming • Easy communication between different languages • Massive class library, from soup to nuts.
Powerbuilder’s Place in .NET • Powerbuilder offers alternatives to Microsoft’s vision. • Release 9.0 • Supports Web Services • Release 10.0 • More support for Web Services • DataWindow .NET • Release 11.0 • Support for compiling Powerscript directly to MSIL • Powerbuilder access to .NET class libraries • Allow .NET applications to access Powerbuilder objects.
Powerbuilder’s Place in .NET In Release 9.0 • The Powerbuilder Web Services Proxy Wizard • Can create a Powerscript proxy from a given WSDL file • JSP Web Services Proxy Wizard • Can generate a custom tag library from a given WSDL file
Powerbuilder’s Place in .NET Coming in the next release • The DataWindow .NET • Will be a citizen of the .NET world • The DataWindow technology will be extended to all languages supported in the Common Language Runtime • Visual Basic.NET, C#, C++ • For the Visual Basic programmer • A worthy competitor to the DataGrid control • The DataWindow offers features that will be enticing to VB programmers • For the Powerbuilder programmer • Where development in .NET is mandated, the investment in DataWindows is protected. • The DataWindow will be familiar
The DataWindow .NET initiative What is the DataWindow.NET? • A .NET data aware control • Drop it on a Window Form • It supports the familiar set of DataWindow properties, events and methods • The .NET data aware object • Instantiated using “new”. • Like the DataWindowControl, it will expose DataStore methods events and properties. • The Powerbuilder database drivers • The DataWindow Builder • For DataWindow creation without Powerbuilder
The DataWindow .NET initiative What is the DataWindow.NET? • DataWindow features supported • Most presentation styles • DataWindow expressions • File SaveAs • XML Import and Export • And more
The DataWindow .NET Initiative Implementation • The DataWindowControl • Is a custom authored Windows Form. • Can be dropped on a Windows Form • Backed up by a C# class library that maps DataWindow functionality to applications running within the Common Language Runtime • This class library includes the DataStore. • The DataWindow engine (server) • Powerbuilder DataWindow engine • Loads DataWindow definitions from pbls and pbrs • Communicates with the database drivers • Processes UI events in the screen real estate of the DataWindowControl • Does the screen painting.
The DataWindow .NET Implementation How do you use it • From the Visual Studio .NET toolbox • Select and drop the DataWindowControl onto a Windows Form. • Two important properties are exposed: • Enter the name of the DataWindow Object to use in the DataWindowControl • Enter a library name from where to load the DataWindow Object .
DataWindow .NET Implementation How do you use it? • Add coding to manipulate the DataWindow • Visual Studio adds some boilerplate coding to instantiate the basic DataWindowControl • Initialize the DataWindow.. DWC1.InitDataWindow( );
DataWindow .NET Implementation How do you use it? • Add coding to manipulate the DataWindow • Instantiate and populate a Transaction object • Using the name “SQLCA” creates a look consistent with Powerscript usage Sybase.DataWindow.Transaction SQLCA = new Sybase.DataWindow.Transaction( ); SQLCA.DBMS = "ODBC"; SQLCA.DBParm = "ConnectString='DSN=EAS Demo DB V4; UID=dba;PWD=sql;sqlcache = 1,disablebind = 1'"; SQLCA.Autocommit = false;
DataWindow .NET Implementation How do you use it? • Connect to the DataSource • Set the DataWindow’s Transaction Object SQLCA.Connect( ); DWC1.SetTransObject ( SQLCA )
DataWindow .NET Implementation How do you use it? • Retrieve the DataWindow • Add and Delete rows on the DataWindow • The full support for all DataWindow methods is intended Int32 rows; rows = DWC1.Retrieve( false, 0 ); DWC1.InsertRow ( 0 ); DWC1.DeleteRow( 0 ); DWC1.Update( );
DataWindow .NET Implementation How do you use it? • DataWindow Events.. • The DataWindowControl will support the same set of events as the DataWindow
DataWindow .NET Implementation How do you use it? • DataStore Events.. • The DataStore will also support events. DS1.RetrieveStart +=new Sybase.DataWindow.DataWindowEvents.RetrieveStartHandler (this.MyRetrieveStart); DS1.RetrieveEnd += new Sybase.DataWindow.DataWindowEvents.RetrieveEndHandler (this.MyRetrieveEnd);
PB Diamond Web Services • UDDI Browser • Can help find Web Services from a UDDI registry in Powerbuilder • Powerbuilder NVO • Can be deployed to EAServer as a Web Services component
Powerbuilder’s place in .NET Powerbuilder futures • A future release of Powerbuilder will: • Compile Powerscript code to MSIL • Allow Powerscript to run under the Common Language Runtime • Allow Powerscript access to .NET class libraries • Allow Powerscript to consume both Microsoft and other .NET objects • Allow .NET objects to access Powerbuilder objects • NVO etc.
PowerScript.NET How to create a PB target for .NET? • Create a .NET target • When creating a PB target, you can choose to create a .NET target. In this target you can import and extend .NET classes written in other languages. • Create a normal target and compile it into MSIL • When creating a PB target, if you choose to create a normal target, you can create a project to compile the target into a .NET application. However, in this target, you cannot import or extend.NET classes written in other languages.
PowerScript.NET Import and use a .NET class // use a .NET namespace imports System.Text.RegularExpressions // create an instance of a .NET class Regex r = create Regex("abc") Match m = r.Match("123abc456") String str If m.success then str = “The position of abc is at ” + string(m.index) end if
PowerScript.NET Extend a .NET class // use a 3rd party namespace imports ThirdPartyNameSpace // Declare a class inheriting from a 3rd party class type MyClass extends ThirdPartyClass int ii_var end // overriding a function forward prototypes public function int doSomething(string s) end public function int doSomething(string s) return doSomethingElse(s) end
PowerScript.NET What can you do with it? • Compile a PowerBuilder target into a .NET application. • Import and use .NET classes written in other languages. • Extend .NET classes written in other languages.
Powerbuilder’s place in .NET Summary • Powerbuilder is committed to full citizenship in the .NET world • We support Web Services in PB 9.0. • Web Service support will be enhanced in PB 10.0 • PB 10.0 will introduce the DataWindow .NET • PB 11.0 will introduce compiler support for .NET