Sybase Mobile Evangelist

Ian Thain

Subscribe to Ian Thain: eMailAlertsEmail Alerts
Get Ian Thain: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


PowerBuilder: Article

Don't Think Big...Think Small

Don't Think Big...Think Small

Over the past 11 years we've seen PowerBuilder grow and develop into the tool it is today. Originally for client/server, then incorporating component development and RAD thin-client development, PowerBuilder is still the best RAD 4 GL available and a key component in Sybase's "Complete e-Business Development" strategy - a great testament to engineering at Sybase. During all that time it's also fair to say that nobody has ever come close to the fantastic DataWindow technology that Sybase owns and developers use so well. There have also been increasing developments in DataWindow technology - it has appeared (or not) as a nonvisual DataStore, a Java DataWindow, and an HTML DataWindow - DataWindows everywhere? Almost! There has been an increase in interest and usage in Pocket PC devices, not only in the consumer areas but also by businesses. Devices that were expensive a few years ago, and not too functional, are now more powerful and cheaper. They can run versions of Office tools such as Word, Excel, and PowerPoint, making the term mobile office a reality. The current Pocket PC is also more than capable of running a full-fledged SQL database like Adaptive Server Anywhere as well as other applications concurrently. Up till now development on the Pocket PC platform has only been available with such tools as EmbeddedVB, EmbeddedC++, and AppForge MobileVB, and most have not been able to reuse any prior investment in technology. As the title says, "don't think bigSthink small." PowerBuilder is now helping corporate development of Pocket PC applications, bringing all the benefits I've mentioned earlier - RAD 4 GL and the DataWindow technology. Now we really can say, DataWindows everywhere! Let me now introduce Pocket PowerBuilder v1.0 (see Figure 1). How Does It Differ from PowerBuilder?
You may be surprised that Pocket PowerBuilder doesn't differ that much from its older, bigger sibling. The vast majority of PowerScript features, functions, events, and controls are supported as are most DataWindow formats. Just imagineSthose neat-looking DataWindows, including graph formats and the power of PowerScript, on a Pocket PC device. Quite a feat of programming by the Concord, MA-based development team, as the Pocket PowerBuilder VM (pkvm10u.dll) only has a footprint of 3.3MB. Most of the exceptions are due to the fact that Pocket PC is a subset of Windows. What is unsupported? I won't give you a full list, but it's not too extensive. Unsupported functions contain anything to do with OLE, DDE, CORBA, Profiling, Printing, Rich Text, and a few more. Unsupported events contain help(), closequery(), anything to do with remote (example remoteexec()), hotlinkalarm(), and toolbarmoved(). Unsupported features within are MDI applications, EAServer connections, Web and JSP targets, and automation server. Another noticeable omission is the lack of a PFC for Pocket PowerBuilder, but there are initiatives already under way for a Foundation Class for it that's lightweight and based on the features of the Pocket PC platform. Just remember..."good things do come in small packages." Synchronization
Pocket PowerBuilder also surpasses PowerBuilder with the introduction of a MobiLink wizard that generates PowerScript code so your application can interact with a MobiLink server. This wizard will generate NVOs and dialogs that can be added easily to your Pocket PowerBuilder application. (Check out Martyn Mallick's article in this issue, "Building 'Occasionally Connected' Mobile Applications with Pocket PowerBuilder.") What Is the Development Cycle?
First develop with the Pocket PowerBuilder IDE on a PC; then test on the PC with the Pocket PowerBuilder IDE, a Pocket PC emulator (especially if you're not the lucky developer with a Pocket PC device), or a Pocket PC device; deploy to the Pocket PC device via ActiveSync for final testing, user acceptance, etc. Migration from PowerBuilder to Pocket PowerBuilder is also very easy, though it's better to make sure your PowerBuilder code conforms to Pocket PowerBuilder before opening it in the Pocket PowerBuilder IDE, as it may not open. Don't worry too much as those nice guys in engineering have given up a facility to change and compile source code. I'll discuss distribution in a later section. Developing for Pocket PC
With Pocket PC development, size matters. Remember, a Pocket PC device has 85% less viewable area than a 1,024x768 average screen (see Figure 2). Some events/actions that we take for granted on a PC are not part of the Pocket PC platform, such as the right-click. As mentioned in a previous section, there's no MDI support, so developers tend to code one window with tab controls as a way of getting around this problem. Menus are also on the bottom of the screen, but act like menus in Windows. Window persistence will be an initial design challenge for the Pocket PowerBuilder developer - when Pocket PC apps are closed via the window-like X in the top right-hand corner of the application, they're actually minimized and stay resident in the device memory. User input is mainly via the Soft Input Panel (SIP) (see Figure 3), so entering text can be slow and tedious, though input can also be by the block/letter recognizer and transcriber. The first utilizes "Palm"-like graffiti and the other normal handwriting recognition. Another problem with the SIP is that when displayed, it covers a third of the screen. Distribution
You've developed and tested your Pocket PowerBuilder application; how do you distribute it? Distribution can be achieved by the Pocket PowerBuilder interface to Microsoft's CABWIZ in the project painter. This enables the automatic creation of your .EXE and .PKDs into distributable .CAB files. The CAB generation process also generates an .INI file for creating a setup.exe. This uses the OpenSource ezsetup, which is GNU and available from www.spbsoftwarehouse.com/enterprise/ devtools/ezsetup.html. The distributable Pocket PowerBuilder files (VM, etc.) are installed with the IDE and can be distributed separately from your application. Good news! There will be no deployment costs for Pocket PowerBuilder applications and those nice guys at iAnywhere have even produced a royalty-free runtime of ASA 8. Compared with the chargeable version of ASA 8, the royalty-free runtime lacks synchronization support of any kind and only supports a static schema, so you can't add/remove/update tables dynamically, but hey, that's not too bad. Performance
Currently, the Intel XScale processor is the fastest CPU being utilized by Pocket PC manufacturers. It's the next generation of the StrongARM processor and is the newest found in Pocket PC 2002 devices to date. In fact, it's hard to find a new Pocket PC device now without a StrongARM-based processor. Pocket PowerBuilder's runtime is only ARM based. The XScale processor has a speed of 200-400Mhz, which is better than the older MIPS, SH3, and ARM processors. There are currently three factors limiting the speed of today's Pocket PC devices - bus speed, OS, and maths coprocessor. Even though XScale processors are being used, the bus speed of most devices is still at 100MHz, which is obviously a slight hardware bottleneck. With regard to the OS (Pocket PC 2002), even though it's better than its predecessors, it's not optimized for the instruction set of the XScale processor (ARM V5), but Pocket PC is optimized for ARM V4 (StrongARM). One thing Intel will probably supply in the future is an XScale compiler to optimize applications, and utilizing this may be on the list of future Pocket PowerBuilder enhancements. Oh yeah, and the maths coprocessor, well there isn't one so stay away from really heavy computations. For a test, try adapting one of the simple PowerBuilder bench tests of looping 5,000 times. On an Intel P4 - 1.7GHz, a PowerBuilder application takes 0.17 secs, where on an Intel XScale 400 MHz Pocket PC, the same code takes 8.5 secs. By my calculations, that's 50 times slower, but don't be put off; remember it's down to the processor, not Pocket PowerBuilder. Keep in mind that on the Pocket PC device the RAM, which is 32MB-128MB (depending on the device and model purchased), is not only used for storing the data on your device but also for the memory while running applications. It's pretty obvious that there could be a trade-off between storing a lot of information and applications with how many you can run. Figure 4 provides a screenshot of my Pocket PC device's memory settings. Luckily Pocket PC devices can extend their storage capability by using CompactFlash or Secure Digital Memory Cards. Then information and applications can be stored on the memory card, freeing up the RAM to run programs on the device. In my device I have a 256MB SD storage card, which contains my ASA databases, Pocket PowerBuilder applications, and other important and large files. Users' expectations of Pocket PC applications are in line with that of desktop applications when we discuss enterprise data. If they use both types of applications, they expect the same data to be available on both. Expectations of the device are somewhat different. Users expect and do get the same interaction, as Pocket PC is also Windows based, but they do appreciate that they will be constrained by the device with regard to display and speed. The question needs to be asked: "What can we do with a Pocket PowerBuilder application to get over some of these limitations and reuse existing logic?" SOAP
Over the past few years we've been telling you to partition your applications and take advantage of your favorite application server (EAServer), so you'll probably want to reuse that code. PocketSOAP can be used and is accessible via a Pocket PowerBuilder interface. This allows Pocket PowerBuilder to call Web services, enabling the reuse of components. Connect to your app server, send the minimum amount of data via a PocketSOAP, and let the app server do all that hard stuff and send the result back. You may want to check out my other article on Pocket PowerBuilder in this issue, "SOAP and PocketSOAP". Mobile and Wireless
Pocket PowerBuilder is the ideal tool to produce applications that can mobilize your field workers. It will enable them to capture data electronically at the source, minimizing data capture and improving the quality of your data. Data can then be synchronized back to enterprise systems with minimal impact, improving turnaround time and increasing the effectiveness of the field workers. With newer PocketPC devices, this synchronization can be via dial-up or wireless connection. Take HP's iPAQ 5450, which has integrated Bluetooth and WiFi 802.11b or Toshiba's e740, which has integrated WiFi 802.11b. Both can be used within the range of a wireless access point and the iPAQ 5450 can use Bluetooth to connect to cellphones for dial-up connection or via GPRS. Pocket-Sized Crystal Ball
We will have just received Pocket PowerBuilder v1.0 around the time of this issue, but what will those guys have in their pockets for the next version (and by the way, a v1.x probably won't be too far away)? How about remote debugging from desktop to the PDA, followed by more database drivers (just like PowerBuilder) and support for the built-in lightweight object store. What about Pocket PowerBuilder applications appearing on the "today" screen - native support for more PDA-specific controls like ink, voice, notification, SIP, mail, OLE objects, COM, and PBNI. There will be a synchronization script painter that will aid in the definition of properties on the database used for the synchronization process, and other features based on user feedback, so start using it now. Will we ever see Pocket PowerBuilder on platforms other than Pocket PC? Probably not; remember, the Pocket PC platform is a subset of the Windows platform. This has made it relatively easy to take PowerBuilder to Pocket PowerBuilder. Other platforms such as Palm are significantly different and Palm devices still lack the power and storage of Pocket PC devices, but anything can happen. Conclusion
Pocket PowerBuilder is the smallest, um, I mean biggest thing to happen in the realm of PowerBuilder and pocket device application development in a long while. Never has such a highly productive 4GL, with the additional strength of the DataWindow, been made available for developers of handheld mobile applications.

More Stories By Ian Thain

As one of the Sybase Technical Evangelists, Ian regularly addresses technical audiences all over the world and his sessions are always very well attended. He also writes education classes, whitepapers, demos and articles for various Sybase products and publishes regularly in Journals such as SYS-CON's PBDJ and International Developer Magazine. He is also the Sybase Unwired Platform & PocketBuilder Evangelist and works closely with the team in Dublin, CA and Concord, MA on new features and demonstrations for the products. In his customer-facing Evangelist role, Ian is very involved with the design, production and testing of Enterprise class Unwired Solutions, that have been implemented using Sybase's Unwired tools for Sybase customers around the globe. In addition, Ian is a dedicated technical expert continually working with Sybase's key partners and clients to enhance the capabilities of the Unwired solutions that Sybase can offer to its customers. Ian can also be found on Twitter @ithain

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.