| By Geogy Zachariah | Article Rating: |
|
| October 7, 2007 06:45 AM EDT | Reads: |
8,840 |
This article talks about the ease with which DataWindows can be designed and consumed in a Microsoft Visual Studio 2005 environment. The DataWindow .NET version 2.5 has the infrastructure to support this concept. With the earlier versions of the DataWindow .NET, such as 1.0, 1.5 and 2.0, the .NET developers had to depend on a standalone DataWindow Designer tool to design DataWindows before consuming it in the .NET Windows Form or ASP.NET applications.
What Is a DataWindow?
For readers who are new to the concept of the DataWindow, let me give a brief introduction on what a DataWindow is all about. The readers familiar with DataWindows may skip this section. The DataWindow is a very popular PowerBuilder technology for building data-driven applications. For any data-driven application, the most common activities the developers perform are:
- Define the data source.
- Retrieve the data from the data source.
- Present the data to the application user.
- Achieve the CRUD (Create, Retrieve, Update, and Delete) functionality.
- DataWindow Object: The metadata describing the data source and presentation information. This is a logical object residing in a .pbl file.
- DataWindow Control: The visual container for the DataWindow object; the Datastore is the non-visual container for the DataWindow object.
These are available to the .NET developers through Sybase's DataWindow .NET product.
"Create" in the article title would mean how to create the DataWindow object and "Consume" would mean how the created DataWindow object can be consumed in the .NET Windows Form and ASP.NET Web applications, all from within the Visual Studio IDE.
Design DataWindows in Visual Studio
DataWindow Designer Visual Studio Plug-ins
A few new custom Visual Studio plug-ins have been created to provide this facility to the .NET developers. In Visual Studio terms they are called packages. There are four packages distributed as part of the DataWindow .NET 2.5 as shown in Figure 1.
The packages communicate with the PowerBuilder native functionality through an interop layer called the Plugout. This explains a little bit about the DataWindow Designer plug-in architecture. The following provides a single line description of each of the packages. Details of the packages are shown in the next sections.
- DataWindow Project: Provides functionality to manage DataWindow projects in the Visual Studio Solution explorer.
- Database Painter: Provides functionality to create database profiles and connections.
- DataWindow Painter: Provides functionality to visually design DataWindow objects in the Visual Studio environment.
- Query Painter: Provides functionality to visually design SQL statements in the Visual Studio environment.
The features provided by this project explorer include the following:
- New or existing .dwproj (DataWindow project) files can be added into the project using Visual Studio's Add New Project or Add Existing Project wizards.
- New or existing .pbl (PowerBuilder library) files can be added into the project using the custom Add New Library or Add Existing Library wizards.
- DataWindow and Query objects can be added into the .pbl files using the custom created Add New Entry wizard.
- Navigate through the pbls, DataWindow objects and query objects.
- Copy and move the DataWindow and query objects across pbls.
- Export DataWindow and query objects as special text files (.srd, .srq).
- Import .srd and .srq files as objects in the project tree.
- Build the project to generate .pbd for all the pbls in the project.
This module helps the developer create and maintain database profiles and connections, and database schema maintenance including tables, views, and users. The equivalent for this in the Visual Studio world would be the Server Explorer containing the DB connections. The red rectangular box in Figure 3 shows the database painter hosted in the Visual Studio dockable window.
A database connection needs to be defined before the user can start creating DataWindow and query objects. Two predefined database profiles are distributed as part of the DataWindow .NET 2.5 installation so that the users can get started with designing DataWindows straight away. This module supports the DataWindow and Query painters by managing the database connections required by the painters.
Query Painter
This module helps the developer create and edit Query objects. The Query objects are logical objects and reside inside the .pbl files of the DataWindow project. They help design SQL statements in a Visual Designer and can be a source for DataWindow object creation.
DataWindow Painter
This is the heart of the article where I describe the DataWindow object design. The DataWindow project, Database painter, and Query painter are the support modules for the DataWindow painter.
DataWindow objects are created using an "Add New Entry" wizard, invoked from the .pbl node of a DataWindow project as shown in Figure 4.
Published October 7, 2007 Reads 8,840
Copyright © 2007 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
About Geogy Zachariah
Geogy Zachariah is a senior software engineer with the PowerBuilder? DataWindow team in Sybase Singapore.
- Ulitzer vs. Ning - a Quick Review
- First Time with AJAX.NET
- Make Your Design Ideas Speak: Using UML in PowerBuilder Projects
- A Review of Key PDF and Font Concepts
- New Features in PowerBuilder 11.5
- PowerBuilder 12 CTP Launch and Code Camp
- PowerBuilder 11.5 Top Feature Picks
- Sybase iAnywhere Broadens Support of Mobile Device Management Solution
- Consuming a SQL Anywhere Native Web Service Using a .NET Client
- PowerBuilder Developer's Journal: Legacy Isn't a Dirty Word
- Sybase to Present at Virtualization Conference & Expo
- How to Circumvent the Seven Deadly Biases
- iPhone Able to Be Adopted by Enterprise Businesses
- SAP & Sybase: Transforming Today's Mobile Workforce
- Ulitzer vs. Ning - a Quick Review
- SYS-CON Launches "PBDJ 2009" Website for PowerBuilder Developer's Journal
- First Time with AJAX.NET
- Make Your Design Ideas Speak: Using UML in PowerBuilder Projects
- Sybase Reports All-Time Best Ever Quarter and Year
- Sybase's Mission to Mobilize the Enterprise is Moving Full Speed Ahead
- PowerBuilder History - How Did It Evolve?
- Custom Common Dialogs Using SetWindowsHookEx
- Book Excerpt: Sybase Adaptive Server Anywhere
- OLE - Extending the Capabilities of PowerBuilder
- DataWindow.NET How To: Data Entry Form
- Sybase ASE 12.5 Performance and Tuning
- DDDW Tips and Tricks
- Working with SOA & Web Services in PowerBuilder
- Office 2003 Toolbar: A New Look For Your Old PowerBuilder App
- Dynamically Creating DataWindow Objects







































