| By Mark Luckasavage | Article Rating: |
|
| August 27, 2008 03:36 PM EDT | Reads: |
3,664 |
Once the SQL Server database was ready, I was all set to look at the presentation and business layers.
I was ready to migrate the application to Web Forms. Once it was migrated I noticed that some PFC ancestor events caused postbacks. I realized that if speed was my goal (and it should be yours also), we needed a new foundation library so unnecessary trips to the server were eliminated. Therefore I created a new native PB ancestor window and business class. My next step was to develop new resizing functionality and replace the DataWindow of_setsort() functionality that I had with the PFC. The resizing logic was easy but the equivalent sorting code in native PB would have been placed in the clicked event and that would cause a postback (so this function was abandoned).
With the foundation library complete, I was ready to reuse the most complex part of the 10.5 application: the business and data layers. I migrated all the DataWindows but needed to add the new company_id column to each of them and to add a new :an_company_id retrieval argument. I also went though each result set and removed any columns that were not required. (I reasoned that although returning entire result sets in the client/server world was fine when you are building reusable classes, we want to conserve resources to achieve the fastest rendering possible in the browser.)
I was ready to address the interface. Since I was using a tabbed interface in my original design, I made a decision to create a window for each of the tab pages. My reasoning behind this is that users may or may not use all tab pages, so the weight of loading any unnecessary code did not make sense. Now each new Web window has a hyperlink to other windows as opposed to the client/server app, which uses a menu and toolbar (see Figure 3).
The next step was the longest process: to leave my client/server skills behind and design a new Web interface. Each tab page in the client/server app has a DataWindow treeview, a main DataWindow, and NEW, SAVE, DELETE and PRINT command buttons. In my first cut of the new Web Forms application (see Figure 4) I had replaced the DataWindow treeviews with native treeviews for performance reasons (the DataWindow control generates more code). Then I had an epiphany: To maximize speed, I reasoned that having treeviews to display data that a user might not need was overkill. So I replaced it with "Find" functionality so the user finds and uses only the data they need (see Figure 5).
With the interface having a new Web look and feel, I was ready to reuse the business logic. Since the itemchanged logic can cause postbacks (unless you implement JavaScript callbacks), I put most of the validation logic in NVOs and called them from each of the windows ue_save events (see Listing 3). I determined that there are two types of messages: informational statements and questions/server errors. I removed as many messageboxes as possible. To notify the user that something had happened, I added a computed text field on each DataWindow to display messages (see Figure 6). (Messageboxes cause a trip to the server when the user clicks their buttons.)
Now that the windows were functioning, the last step was to re-engineer the PBNI SMTP and TAPI OLE functionality with .NET SMTP (with attachments [see Listing 4]) and the Callfire Web Service, respectively (see Listing 5). There are several VoIP Web services available. The .NET SMTP examples can be found in the Sybase newsgroups (search .NET and SMTP). Sybase has a Web Service example that will get you started.
Conclusion
PB 11 works as advertised and is an excellent toolset to get Web apps up and running fast. It did not take too long to rebuild our existing application because I was basically working with the same toolset I've been using for several years. I was also able to reuse the most complex pieces of the original application: the business and data layers!
Our new Web-based application: works great and new customers are coming on board from all over the world. My recommendation is that if you are converting an existing application to be Web-based, check out the differences between Windows Forms and Web Forms applications. After you determine which one will work best for you, take a good look at your foundation classes. Build new classes if you have to and reuse your business logic and DataWindows. The biggest obstacle for me was to think "Web" and not "client/server." I have learned that although I have created static Web sites before, creating a data-driven Web site was a definite paradigm shift. Personally, I am satisfied the technology works well and we will be converting our other applications to Web Forms in the near future.
Published August 27, 2008 Reads 3,664
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Mark Luckasavage
Mark Luckasavage is executive director of PoliceSoftware.com, a New Jersey-based Public Safety company that provides software products for police departments, various public and private organizations, and branches of the homeland security department. He is also a PowerBuilder consultant who has worked with PB since PB 2.0a. All of PoliceSoftware.com's programs are coded in PB 10.5 PFC and use Sybase SQL Anywhere.
- Why SOA Needs Cloud Computing - Part 1
- Cloud Expo and The End of Tech Recession
- The Transition to Cloud Computing: What Does It Mean For You?
- A Rules Engine Built in PowerBuilder
- Sybase Named “Silver Sponsor” of iPhone Developer Summit
- How PowerBuilder Got Its Groove Back
- The Cloud Has Cross-Border Ambitions
- Ulitzer Names The World's 30 Most Influential Virtualization Bloggers
- Ulitzer Named "New Media" Partner of Greatly Anticipated iStrategy Event in Berlin
- Risks and Enterprise Mobility?
- Steps for Success in Enterprise Mobility?
- Are Mobile Luddites Resisting Mobility?
- The Difference Between Web Hosting and Cloud Computing
- Sybase CTO to Speak at 4th International Cloud Computing Expo
- Why SOA Needs Cloud Computing - Part 1
- Cloud Expo and The End of Tech Recession
- The Transition to Cloud Computing: What Does It Mean For You?
- Five Reasons to Choose a Private Cloud
- Seeding The Cloud: The Future of Data Management
- The Threat Behind the Firewall
- Economy Drives Adoption of Virtual Lab Technology
- Tips for Efficient PaaS Application Design
- A Rules Engine Built in PowerBuilder
- Sybase Named “Silver Sponsor” of iPhone Developer Summit
- Where Are RIA Technologies Headed in 2008?
- PowerBuilder History - How Did It Evolve?
- The Top 250 Players in the Cloud Computing Ecosystem
- Custom Common Dialogs Using SetWindowsHookEx
- DDDW Tips and Tricks
- OLE - Extending the Capabilities of PowerBuilder
- DataWindow.NET How To: Data Entry Form
- Book Excerpt: Sybase Adaptive Server Anywhere
- Sybase ASE 12.5 Performance and Tuning
- Working with SOA & Web Services in PowerBuilder
- Office 2003 Toolbar: A New Look For Your Old PowerBuilder App
- Dynamically Creating DataWindow Objects

































