280 likes | 597 Views
Pocket PowerBuilder. And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com. Agenda. Introduction Unwired Enterprise MobiLink Developing An Application Demonstrations. Introduction.
E N D
Pocket PowerBuilder And Database Applications
Ian ThainPocket PowerBuilder EvangelistPTOG Evangelist Team, Sybase Inc.ian.thain@sybase.com
Agenda • Introduction • Unwired Enterprise • MobiLink • Developing An Application • Demonstrations
Introduction • Over the last 11 years we have seen PowerBuilder grow and develop into the tool it is today. Originally for Client Server, then incorporating Component Development & RAD Thin Client Development. • Also over the last 11 years we have seen increasing developments in DataWindow technology that has seen it appear (or not) as a non-visual DataStore, Java DataWindow and HTML DataWindow • DataWindows EVERYWHERE? Well nearly!
Introduction • "Don't think big…Think Small!!" • Pocket PowerBuilder is now coming to aid corporate development of Pocket PC applications, brining all the benefits • RAD 4 GL and even the DataWindow technology. • So we really can now say, DataWindows EVERYWHERE!!!!
Unwired Enterprise • Liquidity + Mobility = Unwired Enterprise • Liquidity - Free flowing information with economic value • Mobility - Freedom to work anytime, anywhere
Enterprise Mobile Applications • Key areas for a mobile application • Usability (including intuitiveness, efficiency, ease of use & reliability) • Innovation (including New Functionality) – maybe from using mobile technologies • BPI (including extending existing systems) – it should fit well into existing business processes • ROI – As always a return on investment is a major factor
Enterprise Mobile Applications • Potential Systems for Mobile Applications • Data Collection • Inventory Management • Customer Relationship Management • Event Tracking • Sales Force Automation • Healthcare • Field Force Automation • Sales Force Automation • Mobile Healthcare
Mobile Smart Client • Mobile Smart Client • Application where client side business logic is executed on device • Persistent data storage on the device • Application can be executed at any time, even without a wireless connection • Integration to the enterprise is typically provided via synchronization • Client application communicates data to the back end via a synchronization server
Different Functionality • Synchronization • Pocket PowerBuilder also surpasses PowerBuilder with the introduction of a MobiLink wizard • Generates PowerScript code (NVO’s) & Windows for within your application, to interact with a MobiLink Server.
Different Functionality • Adaptive Server Anywhere mobile database • Uses full data storage capabilities of Adaptive Server Anywhere on Windows CE client • Database access via ODBC • MobiLink data synchronization • MobiLink bi-directional data synchronization used to integrate with other enterprise databases (Sybase ASE and ASA, Oracle, MS SQL Server, IBM DB2) • New component to manage synchronization properties & maintenance of synchronization
Publication • A Database Object in the Remote Database data to be synchronized • Tables can be synchronized • Entirely • Subset of Columns • Subset of Rows • Subset of Columns & Rows • Define a Publication • Define a Synchronization User • Define a Synchronization Subscription
Remote Database • Located on the mobile device • Can be built with • Sybase ASA • UltraLite • Must contain at least one Publication to define which tables will be synchronized • Must contain at least one Synchronization Subscription to link a Synchronization user with a set of Publications • Typically a subset of a consolidated database • Data specific or that mobile user
Consolidated Database • Central / Master DataStore with which the remote synchronizes with • Can be built with • Sybase ASA • Sybase ASE • Oracle • MS SQL Server • IBM DB2 • Typically an existing Enterprise Database
Consolidated Database • MobiLink uses system tables in the Consolidated database to store • Synchronization scripts • Synchronization progress & status information • Synchronization User information • Automatically created in ASA Database • MobiLink Setup scripts for other Consolidated Databases • MobiLink uses ODBC to connect to the Consolidated DB
Synchronization Scripts • During synchronization MobiLink progresses through a series of events • Each event can be associated with once synchronization script • Synchronization scripts • Direct the data flow during the process • Allow tasks to be performed at various points • Written in the native SQL of the Consolidated Database • Can use versioning • Remote must specify the version of the scripts to use
MobiLink Server • Connects to the Consolidated Database • Waits for Synchronization requests from Remote DB • Processes data uploaded from the Remote DB • Selects data from the Consolidated Database for download to the remote
dbmlsync • Synchronization is initiated by a client application via the dbmlsync utility from ASA Remote databases • TCP/IP, SSL • HTTP/HTTPS • ActiveSync • Read Database engine transaction log • Builds an upstream with the a summary of the changes to the specific publication since the last synchronization • Applies the downstream from the MobiLink server to the Remote Database
1. Upload MobiLink dbmlsync 2. Download 3. Ack Download ODBC 1. Upload • ASA or UltraLite keep track of all changes since previous synchronization • All changes are sent in a single upload stream • MobiLink applies changes in a single transaction 2. Download • Scripts in the consolidated database determine changes that need to be downloaded • All changes are sent in a single download stream 3. Acknowledge download • Optional Remote ASA Database Consolidated DB MobiLink – ASA Synchronization
MobiLink – ASA Synchronization • Flexible and robust bi-directional synchronization • Support Sybase, Oracle, IBM DB2, Microsoft SQL Server • Synchronization scripts can be written in SQL, Java or any .NET language • Secure • Built-in authentication • 128-bit encryption of communication stream • Support for sub-setting and partitioning of data • Built-in conflict detection and resolution • Scalable to thousands of remote users • Robust error handling
MobiLink - Quick Start • Files located in \Samples\MobiLink\Autoscripting • Create and setup consolidated and remote databases • Use Sybase database creation wizard • Create ODBC datasources • Populate databases with ISQL • Run setup script appropriate for consolidated DB • Identify tables and columns for synchronization • Add publications, ML Users & subscriptions on Remote DB • Add tables & users for synchronizationn on Consolidated • Write scripts to upload and download data • Use –za switch on the MobilLink Server • and ‘SendColumnNames=on’ on the MobiLink client • to automatically generate scripts for you • You are now synchronizing!
Developing an Application • When developing a Mobile Application always work against the Remote Database • Best to deploy an empty Remote Database & fill with data on the first Sync. • Use PPB to generate Synchronization logic in NVO’s
Developing an Application • DSN on mobile device specifies which ASA Database the app uses • [ODBC] • uid=dba • pwd=sql • enginename=Picture_remote • databasename=Picture_remote • databasefile=\Picture_remote.db • start=\Program Files\Sybase\ASA\dbsrv8.exe –q • driver=dbodbc8.dll
SOAP (Web Services) Device Enterprise App Server Pocket PowerBuilder Virtual Machine Sample Application) TCP/IP HTTP HTTPS ActiveSync (wired or wireless) Consolidated Database (Sybase/Oracle/ Microsoft/IBM) MobiLink ASA ML PPB Application Architecture
Demonstrations • Basic Pocket PowerBuilder App • Create a Consolidated DB • Create the Remote DB • Create publications, subsrciptions & users on the remote • Create users & tables for sync on the consolidated • Deploy remote database & dsn • Start Mobilink • Use the wizard to generate an application • Build a DataWindow Object • Place objects on the window • Code PowerScript • Deploy • Run
Conclusions • Pocket PowerBuilder used along with ASA for CE and MobiLink can create very powerful Smart Client Applications • Data can be synchronized back to the Enterprise Database
Pocket PowerBuilder Code Examples • Pocket PowerBuilder code examples can be found on the CodeXchange, http://pocketpb.codexchange.sybase.com
Questions and Answers Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com Check out PBDJ for Pocket PowerBuilder articles